event-timeout.any.js (457B)
1 // META: title=XMLHttpRequest: timeout event 2 3 var test = async_test(); 4 test.step(function () { 5 var client = new XMLHttpRequest(); 6 client.ontimeout = function () { 7 test.step(function () { 8 assert_equals(client.readyState, 4); 9 test.done(); 10 }); 11 }; 12 client.timeout = 5; 13 client.open("GET", "resources/delay.py?ms=20000"); 14 client.send(null); 15 test.step_timeout(() => { 16 assert_unreached("ontimeout not called."); 17 }, 1000); 18 });