OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script> |
| 5 var callbackCount = 0; |
| 6 |
| 7 function finishJSTestIfNeeded() |
| 8 { |
| 9 callbackCount++; |
| 10 if (2 == callbackCount) |
| 11 window.parent.finishJSTest(); |
| 12 } |
| 13 |
| 14 function importLoaded() |
| 15 { |
| 16 window.parent.headlineText = target.import.querySelector('h1').innerHTML; |
| 17 window.parent.shouldBe('headlineText', '"Hello"'); |
| 18 finishJSTestIfNeeded(); |
| 19 } |
| 20 |
| 21 function importError() |
| 22 { |
| 23 window.parent.wrongImport = wrong.import; |
| 24 window.parent.shouldBeNull('wrongImport'); |
| 25 finishJSTestIfNeeded(); |
| 26 } |
| 27 </script> |
| 28 <link id="target" rel="import" href="hello.html" onload="importLoaded()"> |
| 29 <link id="wrong" rel="import" href="nosuch.html" onerror="importError()"> |
| 30 </head> |
| 31 <body> |
| 32 </body> |
| 33 </html> |
OLD | NEW |