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

Unified Diff: LayoutTests/http/tests/security/resources/link-crossorigin-common.js

Issue 135723008: Add CORS support for <link> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add setCrossOriginAccessControl() helper to avoid repetition matching CORS attribute value 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/resources/link-crossorigin-common.js
diff --git a/LayoutTests/http/tests/security/resources/link-crossorigin-common.js b/LayoutTests/http/tests/security/resources/link-crossorigin-common.js
new file mode 100644
index 0000000000000000000000000000000000000000..f32b65b517514ab9b222273810824625a0aa5167
--- /dev/null
+++ b/LayoutTests/http/tests/security/resources/link-crossorigin-common.js
@@ -0,0 +1,26 @@
+// Tiny test rig for all security/link-crossorigin-*.html tests,
+// which exercise <link> + CORS variations.
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+// The common case is to have four sub-tests. To override
+// for a test, assign window.test_count.
+var default_test_count = 4;
+
+var event_count = 0;
+test_count = window.test_count || default_test_count;
+
+function finish(pass, msg) {
+ var out = document.querySelector("pre");
+ var txt = pass ? "PASS" : "FAIL";
+ if (msg) txt += ": " + msg;
+ out.appendChild(document.createTextNode(txt));
+ out.appendChild(document.createElement("br"));
+ if (++event_count >= test_count && window.testRunner)
+ testRunner.notifyDone();
+}
+
+function pass() { finish(true); }
+function fail() { finish(false); }
« no previous file with comments | « LayoutTests/http/tests/security/resources/green-background-allow-star.php ('k') | Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698