Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: LayoutTests/fast/html/imports/import-script.html

Issue 19762002: [HTML Imports] Let script of imported document running. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made a test more robust. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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>
OLDNEW
« no previous file with comments | « LayoutTests/fast/html/imports/import-master-expected.txt ('k') | LayoutTests/fast/html/imports/import-script-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698