| 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 <script> | 5 <script> |
| 6 window.jsTestIsAsync = true; | 6 window.jsTestIsAsync = true; |
| 7 window.scheduledImportCount = 0; | 7 window.scheduledImportCount = 0; |
| 8 | 8 |
| 9 setPrintTestResultsLazily(); |
| 9 description("This ensures that load and error events are fired on sub-imports.")
; | 10 description("This ensures that load and error events are fired on sub-imports.")
; |
| 10 | 11 |
| 11 function handleEvent(event) | 12 function handleEvent(event) |
| 12 { | 13 { |
| 13 theEvent = event; | 14 theEvent = event; |
| 14 switch (event.target.getAttribute("href")) { | 15 switch (event.target.getAttribute("href")) { |
| 15 case "hello.html": | 16 case "hello.html": |
| 16 shouldBe("theEvent.type", "'load'"); | 17 shouldBe("theEvent.type", "'load'"); |
| 17 shouldBe("theEvent.target.ownerDocument", "root.import"); | 18 shouldBe("theEvent.target.ownerDocument", "root.import"); |
| 18 break; | 19 break; |
| 19 case "no-such-file.html": | 20 case "no-such-file.html": |
| 20 shouldBe("theEvent.type", "'error'"); | 21 shouldBe("theEvent.type", "'error'"); |
| 21 shouldBe("theEvent.target.ownerDocument", "root.import"); | 22 shouldBe("theEvent.target.ownerDocument", "root.import"); |
| 22 break; | 23 break; |
| 23 default: | 24 default: |
| 24 } | 25 } |
| 25 | 26 |
| 26 window.scheduledImportCount--; | 27 window.scheduledImportCount--; |
| 27 if (!window.scheduledImportCount) | 28 if (!window.scheduledImportCount) |
| 28 finishJSTest(); | 29 finishJSTest(); |
| 29 } | 30 } |
| 30 </script> | 31 </script> |
| 31 <link id="root" rel="import" href="resources/onload-root.html"> | 32 <link id="root" rel="import" href="resources/onload-root.html"> |
| 32 </head> | 33 </head> |
| 33 <body> | 34 <body> |
| 34 </body> | 35 </body> |
| 35 </html> | 36 </html> |
| OLD | NEW |