blob: 9098eebc743ec599b99ad4fc64600d9a17527f74 [file] [log] [blame]
Philip Jägenstedtc053f402014-01-22 17:02:181<!doctype html>
2<meta charset=utf-8>
3<title>XMLHttpRequest: The send() method: Fire an event named load (synchronous flag is unset)</title>
4<script src="/resources/testharness.js"></script>
5<script src="/resources/testharnessreport.js"></script>
Ms2ger91fef142014-11-01 09:24:376 <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onload" data-tested-assertations="../.." />
7 <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-load" data-tested-assertations="../.." />
8 <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following::a[contains(@href,'#switch-done')]/.." />
9 <link rel="help" href="https://xhr.spec.whatwg.org/#switch-done" data-tested-assertations="following::ol/li[6]" />
Philip Jägenstedtc053f402014-01-22 17:02:1810<div id="log"></div>
11
12<script>
13 var test = async_test();
14 test.step(function() {
15 var client = new XMLHttpRequest();
16 client.onload = test.step_func(function(e) {
17 assert_true(e instanceof ProgressEvent);
18 assert_equals(e.type, "load");
19 assert_equals(client.readyState, 4);
20 test.done();
21 });
22 client.onreadystatechange = test.step_func(function() {
23 if (client.readyState !== 4) return;
24
25 setTimeout(test.step_func(function() {
26 assert_unreached("Didn't get load event within 4ms of readystatechange==4");
27 }), 4);
28 });
29 client.open("GET", "resources/well-formed.xml");
30 client.send(null);
31 });
Hallvord R. M. Steen6bb53052012-11-09 10:47:4932</script>