Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / security / resources / link-crossorigin-common.js
1 // Tiny test rig for all security/link-crossorigin-*.html tests,
2 // which exercise <link> + CORS variations.
3
4 self.jsTestIsAsync = true;
5
6 if (window.testRunner) {
7     testRunner.dumpAsText();
8     testRunner.waitUntilDone();
9 }
10
11 // The common case is to have four sub-tests. To override
12 // for a test, assign window.test_count.
13 var default_test_count = 4;
14
15 var event_count = 0;
16 test_count = window.test_count || default_test_count;
17
18 function finish(pass, msg) {
19     if (pass)
20         testPassed(msg || "");
21      else
22         testFailed(msg || "");
23     if (++event_count >= test_count)
24         finishJSTest();
25 }
26
27 function pass() { finish(true); }
28 function fail() { finish(false); }