| Philip Jägenstedt | c053f40 | 2014-01-22 17:02:18 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>XMLHttpRequest: loadend event</title> |
| 5 | <script src="/resources/testharness.js"></script> |
| 6 | <script src="/resources/testharnessreport.js"></script> |
| Ms2ger | 91fef14 | 2014-11-01 09:24:37 | [diff] [blame] | 7 | <link rel="help" href="https://xhr.spec.whatwg.org/#handler-xhr-onloadend" data-tested-assertations="/../.." /> |
| 8 | <link rel="help" href="https://xhr.spec.whatwg.org/#event-xhr-loadend" data-tested-assertations="/../.." /> |
| 9 | <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="/following-sibling::ol/li[10]" /> |
| 10 | <link rel="help" href="https://xhr.spec.whatwg.org/#infrastructure-for-the-send()-method" data-tested-assertations="following::a[contains(@href,'#switch-done')]/.." /> |
| 11 | <link rel="help" href="https://xhr.spec.whatwg.org/#switch-done" data-tested-assertations="following::ol[1]/li[7]" /> |
| Philip Jägenstedt | c053f40 | 2014-01-22 17:02:18 | [diff] [blame] | 12 | </head> |
| 13 | <body> |
| 14 | <div id="log"></div> |
| 15 | <script> |
| 16 | var test = async_test(); |
| 17 | test.step(function() { |
| 18 | var client = new XMLHttpRequest(); |
| 19 | client.onloadend = test.step_func(function(e) { |
| 20 | assert_true(e instanceof ProgressEvent); |
| 21 | assert_equals(e.type, "loadend"); |
| 22 | test.done(); |
| 23 | }); |
| 24 | client.onreadystatechange = function() { |
| 25 | if (client.readyState !== 4) return; |
| 26 | setTimeout(test.step_func(function() { |
| 27 | assert_unreached("onloadend not called after 100 ms"); |
| 28 | }), 100); |
| 29 | }; |
| 30 | client.open("GET", "resources/well-formed.xml"); |
| 31 | client.send(null); |
| 32 | }); |
| 33 | </script> |
| 34 | </body> |
| 35 | </html> |