Index: LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-conditional.html |
diff --git a/LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-conditional.html b/LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-conditional.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..44cce22b9d8c5a665f5941ffaef3d45148281438 |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/script-crossorigin-loads-cross-origin-conditional.html |
@@ -0,0 +1,27 @@ |
+<!DOCTYPE HTML> |
+<p>Test that script elements that are fetched with CORS enabled and conditionally, pass the expected access controls.</p> |
+<pre></pre> |
+<script> |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+function log(msg) |
+{ |
+ document.querySelector("pre").innerHTML = msg; |
+} |
+ |
+var count = 0; |
+function finish(ok) { |
+ // Called by the iframe upon completing the fetch of its script. |
+ if (ok && count++ < 2) { |
+ document.querySelector("iframe").contentWindow.location.reload(); |
+ return; |
+ } |
+ log((ok ? "PASS" : "FAIL") + ": crossorigin script repeatedly and conditionally loaded."); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+} |
+</script> |
+<iframe src="resources/iframe-crossorigin-script.html""></iframe> |