OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 | 8 |
9 function handle(list, id, event) | 9 function handle(list, id, event) |
10 { | 10 { |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 window.caughtFoo.length = 0; | 25 window.caughtFoo.length = 0; |
26 target.dispatchEvent(new CustomEvent("foo", { bubbles: true })); | 26 target.dispatchEvent(new CustomEvent("foo", { bubbles: true })); |
27 shouldBe("window.caughtFoo", "['foo@target', 'foo@root']"); | 27 shouldBe("window.caughtFoo", "['foo@target', 'foo@root']"); |
28 | 28 |
29 window.caughtFoo.length = 0; | 29 window.caughtFoo.length = 0; |
30 target.dispatchEvent(new MouseEvent("click", { bubbles: true })); | 30 target.dispatchEvent(new MouseEvent("click", { bubbles: true })); |
31 shouldBe("window.caughtFoo", "[]"); | 31 shouldBe("window.caughtFoo", "[]"); |
32 } | 32 } |
33 | 33 |
| 34 window.jsTestIsAsync = true; |
| 35 |
34 var xhrForXML = new XMLHttpRequest(); | 36 var xhrForXML = new XMLHttpRequest(); |
35 xhrForXML.open("GET", "resources/hello-xhr-event.xml", false); | 37 xhrForXML.open("GET", "resources/hello-xhr-event.xml", false); |
36 xhrForXML.send(); | 38 xhrForXML.send(); |
37 testEventsFiredOn(xhrForXML.responseXML); | 39 testEventsFiredOn(xhrForXML.responseXML); |
38 | 40 |
| 41 // Must run asynchronous to use responseType. |
39 var xhrForHTML = new XMLHttpRequest(); | 42 var xhrForHTML = new XMLHttpRequest(); |
40 xhrForHTML.open("GET", "resources/hello-xhr-event.html", false); | 43 xhrForHTML.open("GET", "resources/hello-xhr-event.html", true); |
41 xhrForHTML.responseType = "document"; | 44 xhrForHTML.responseType = "document"; |
| 45 xhrForHTML.onload = function() { |
| 46 testEventsFiredOn(xhrForHTML.response); |
| 47 finishJSTest(); |
| 48 }; |
42 xhrForHTML.send(); | 49 xhrForHTML.send(); |
43 testEventsFiredOn(xhrForHTML.response); | |
44 | 50 |
45 </script> | 51 </script> |
46 </body> | 52 </body> |
47 </html> | 53 </html> |
OLD | NEW |