| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 <script> | 5 <script> |
| 6 window.jsTestIsAsync = true; |
| 6 testRunner.waitUntilDone(); | 7 testRunner.waitUntilDone(); |
| 7 | 8 |
| 8 var givenLoadEventTargets = []; | 9 var givenLoadEventTargets = []; |
| 9 function handleLoad(event) | 10 function handleLoad(event) |
| 10 { | 11 { |
| 11 givenLoadEventTargets.push(event.target.id); | 12 givenLoadEventTargets.push(event.target.id); |
| 12 if (givenLoadEventTargets.length == 4) { | 13 if (givenLoadEventTargets.length == 4) { |
| 13 shouldBe("['bye', 'hello1', 'hello2', 'hello3']", "givenLoadEventTargets
.sort()"); | 14 shouldBe("['bye', 'hello1', 'hello2', 'hello3']", "givenLoadEventTargets
.sort()"); |
| 14 testRunner.notifyDone(); | 15 finishJSTest(); |
| 15 } | 16 } |
| 16 } | 17 } |
| 17 </script> | 18 </script> |
| 18 <link id="hello1" rel="import" href="resources/hello.html" onload="handleLoad(ev
ent)"> | 19 <link id="hello1" rel="import" href="resources/hello.html" onload="handleLoad(ev
ent)"> |
| 19 <link id="hello2" rel="import" href="resources/hello.html" onload="handleLoad(ev
ent)"> | 20 <link id="hello2" rel="import" href="resources/hello.html" onload="handleLoad(ev
ent)"> |
| 20 </head> | 21 </head> |
| 21 <body> | 22 <body> |
| 22 <script> | 23 <script> |
| 23 var linkToInsert = document.createElement("link"); | 24 var linkToInsert = document.createElement("link"); |
| 24 linkToInsert.id = "bye"; | 25 linkToInsert.id = "bye"; |
| 25 linkToInsert.setAttribute("rel", "import"); | 26 linkToInsert.setAttribute("rel", "import"); |
| 26 linkToInsert.setAttribute("href", "resources/bye.html"); | 27 linkToInsert.setAttribute("href", "resources/bye.html"); |
| 27 linkToInsert.onload = handleLoad; | 28 linkToInsert.onload = handleLoad; |
| 28 document.head.appendChild(linkToInsert); | 29 document.head.appendChild(linkToInsert); |
| 29 </script> | 30 </script> |
| 30 <link id="hello3" rel="import" href="resources/hello.html" onload="handleLoad(ev
ent)"> | 31 <link id="hello3" rel="import" href="resources/hello.html" onload="handleLoad(ev
ent)"> |
| 31 <script src="../../js/resources/js-test-post.js"></script> | |
| 32 </body> | 32 </body> |
| 33 </html> | 33 </html> |
| OLD | NEW |