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

Unified Diff: LayoutTests/http/tests/security/script-crossorigin-loads-correctly-dual.html

Issue 137983010: (Re)organize handling of CORS access control during resource loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: HTMLImportLoader no longer needs a ResourceFetcher Created 6 years, 11 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/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>

Powered by Google App Engine
This is Rietveld 408576698