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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Tiny test rig for all security/link-crossorigin-*.html tests, 1 // Tiny test rig for all security/link-crossorigin-*.html tests,
2 // which exercise <link> + CORS variations. 2 // which exercise <link> + CORS variations.
3
4 self.jsTestIsAsync = true;
5
3 if (window.testRunner) { 6 if (window.testRunner) {
4 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
5 testRunner.waitUntilDone(); 8 testRunner.waitUntilDone();
6 } 9 }
7 10
8 // The common case is to have four sub-tests. To override 11 // The common case is to have four sub-tests. To override
9 // for a test, assign window.test_count. 12 // for a test, assign window.test_count.
10 var default_test_count = 4; 13 var default_test_count = 4;
11 14
12 var event_count = 0; 15 var event_count = 0;
13 test_count = window.test_count || default_test_count; 16 test_count = window.test_count || default_test_count;
14 17
15 function finish(pass, msg) { 18 function finish(pass, msg) {
16 var out = document.querySelector("pre"); 19 if (pass)
17 var txt = pass ? "PASS" : "FAIL"; 20 testPassed(msg || "");
18 if (msg) txt += ": " + msg; 21 else
19 out.appendChild(document.createTextNode(txt)); 22 testFailed(msg || "");
20 out.appendChild(document.createElement("br")); 23 if (++event_count >= test_count)
21 if (++event_count >= test_count && window.testRunner) 24 finishJSTest();
22 testRunner.notifyDone();
23 } 25 }
24 26
25 function pass() { finish(true); } 27 function pass() { finish(true); }
26 function fail() { finish(false); } 28 function fail() { finish(false); }
OLDNEW
« 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