| <!DOCTYPE html> |
| <html> |
| <head> |
| <script> |
| var callbackCount = 0; |
| |
| function finishJSTestIfNeeded() |
| { |
| callbackCount++; |
| if (2 == callbackCount) { |
| importError(); |
| importLoaded(); |
| window.parent.finishJSTest(); |
| } |
| } |
| |
| function importLoaded() |
| { |
| window.parent.headlineText = target.import.querySelector('h1').innerHTML; |
| window.parent.shouldBe('headlineText', '"Hello"'); |
| } |
| |
| function importError() |
| { |
| window.parent.wrongImport = wrong.import; |
| window.parent.shouldBeNull('wrongImport'); |
| } |
| </script> |
| <link id="target" rel="import" href="hello.html" onload="finishJSTestIfNeeded()"> |
| <link id="wrong" rel="import" href="nosuch.html" onerror="finishJSTestIfNeeded()"> |
| </head> |
| <body> |
| </body> |
| </html> |