Index: LayoutTests/http/tests/security/script-crossorigin-loads-correctly-dual.html |
diff --git a/LayoutTests/http/tests/security/script-crossorigin-loads-correctly-dual.html b/LayoutTests/http/tests/security/script-crossorigin-loads-correctly-dual.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..594a36c561d29b0976592316a27be8eea6da9dac |
--- /dev/null |
+++ b/LayoutTests/http/tests/security/script-crossorigin-loads-correctly-dual.html |
@@ -0,0 +1,24 @@ |
+<!DOCTYPE HTML> |
+<p>This test passes if a script resource is loaded twice if asked to fetch it with and without CORS enabled.</p> |
+<pre></pre> |
+<!-- Non-CORS enabled script load, supplying credentials. --> |
+<script src="http://localhost:8000/security/resources/cors-script.php?cors=true&credentials=true&value=1&value_cors=2"></script> |
+<script> |
+if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
+ |
+var expected = "12"; |
+ |
+// Copy the 'result' value set by external script. |
+var outcome = result; |
+</script> |
+<!-- CORS enabled script load, supplying credentials. Should not re-use above cached script, as response will differ. --> |
+<script crossorigin="use-credentials" src="http://localhost:8000/security/resources/cors-script.php?cors=true&credentials=true&value=1&value_cors=2"></script> |
+<script> |
+outcome += result; |
+document.querySelector("pre").innerHTML = outcome === expected ? "PASS" : "FAIL"; |
+if (window.testRunner) |
+ testRunner.notifyDone(); |
+</script> |