OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 <script> |
| 6 var loadedScripts = []; |
| 7 var numLoaded = 0; |
| 8 var labels = ["InlineParser", "InlineDynamic", "ExternalParser", "ExternalDynami
c", "ExternalAsync"].sort(); |
| 9 |
| 10 document.notifyLoaded = function(label, doc) |
| 11 { |
| 12 givenDocument = doc; |
| 13 shouldBe("givenDocument", "document"); |
| 14 shouldBe("givenDocument.currentScript.ownerDocument", "leaf.import"); |
| 15 |
| 16 loadedScripts.push({ label: label, document: document, script: document.curr
entScript, order: numLoaded++ }); |
| 17 if (labels.length != numLoaded) |
| 18 return; |
| 19 |
| 20 loadedLabels = loadedScripts.map(function(o) { return o.label; }).sort(); |
| 21 shouldBe("labels", "loadedLabels"); |
| 22 |
| 23 finishJSTest(); |
| 24 }; |
| 25 </script> |
| 26 <link id="leaf" rel="import" href="resources/script-leaf.html"> |
| 27 </head> |
| 28 <body> |
| 29 <script> |
| 30 description("Test that scripts in imported documents are executed"); |
| 31 window.jsTestIsAsync = true; |
| 32 |
| 33 var dynamicallyInsertedInlineScript = leaf.import.createElement("script"); |
| 34 dynamicallyInsertedInlineScript.innerHTML = "document.notifyLoaded('InlineDynami
c', document);" |
| 35 leaf.import.body.appendChild(dynamicallyInsertedInlineScript); |
| 36 |
| 37 var dynamicallyInsertedExternalScript = leaf.import.createElement("script"); |
| 38 dynamicallyInsertedExternalScript.setAttribute("src", "script-leaf-external-dyna
mic.js"); |
| 39 leaf.import.body.appendChild(dynamicallyInsertedExternalScript); |
| 40 </script> |
| 41 <script src="../../js/resources/js-test-post.js"></script> |
| 42 </body> |
| 43 </html> |
OLD | NEW |