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

Unified Diff: LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.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, 5 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html
diff --git a/LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html b/LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html
new file mode 100644
index 0000000000000000000000000000000000000000..40d4cab0250c872cad485bb7988f046c40d61012
--- /dev/null
+++ b/LayoutTests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="/js-test-resources/js-test-pre.js"></script>
+<link id="target" rel="import" href="http://localhost:8000/htmlimports/resources/cors-having-crossorigin-scripts.cgi">
+</head>
+<body>
+<script>
+description("This test ensures that crossorigin-marked script elements are blocked properly");
+window.jsTestIsAsync = true;
+
+function testAndDone()
+{
+ shouldBe("document.externalScriptHasRun", "undefined");
+ shouldBe("document.corsExternalScriptHasRun", "undefined");
+ shouldBeTrue("document.corsExternalScriptForLocalhostHasRun");
+ finishJSTest();
+}
+
+var retryCount = 0;
+
+// This should be called run-check.js
+function check()
+{
+ if (!document.corsExternalScriptForLocalhostHasRun) {
+ retryCount++;
+ if (10 < retryCount) {
+ console.log("FAIL: Retried too many times.");
+ return finishJSTest();
+ }
+
+ return setTimeout(check, 100);
+ }
+
+ testAndDone();
+}
+
+</script>
+<script src="/js-test-resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698