event-loadend.any.js (559B)
1 // META: title=XMLHttpRequest: loadend event 2 3 var test = async_test(); 4 test.step(function () { 5 var client = new XMLHttpRequest(); 6 client.onloadend = test.step_func(function (e) { 7 assert_true(e instanceof ProgressEvent); 8 assert_equals(e.type, "loadend"); 9 test.done(); 10 }); 11 client.onreadystatechange = function () { 12 if (client.readyState !== 4) return; 13 test.step_timeout(() => { 14 assert_unreached("onloadend not called after 100 ms"); 15 }, 100); 16 }; 17 client.open("GET", "resources/well-formed.xml"); 18 client.send(null); 19 });