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

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

Issue 399653002: Rework CORS <link rel=stylesheet> tests as js-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move up window.test_count assignment Created 6 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
« no previous file with comments | « LayoutTests/http/tests/security/link-crossorigin-subresource-use-credentials-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
index f32b65b517514ab9b222273810824625a0aa5167..a7f1bdfc2e8b5b750cb054ce9cbed28af0feb441 100644
--- a/LayoutTests/http/tests/security/resources/link-crossorigin-common.js
+++ b/LayoutTests/http/tests/security/resources/link-crossorigin-common.js
@@ -1,5 +1,8 @@
// Tiny test rig for all security/link-crossorigin-*.html tests,
// which exercise <link> + CORS variations.
+
+self.jsTestIsAsync = true;
+
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
@@ -13,13 +16,12 @@ 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();
+ if (pass)
+ testPassed(msg || "");
+ else
+ testFailed(msg || "");
+ if (++event_count >= test_count)
+ finishJSTest();
}
function pass() { finish(true); }
« no previous file with comments | « LayoutTests/http/tests/security/link-crossorigin-subresource-use-credentials-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698