OLD | NEW |
(Empty) | |
| 1 // Tiny test rig for all security/link-crossorigin-*.html tests, |
| 2 // which exercise <link> + CORS variations. |
| 3 if (window.testRunner) { |
| 4 testRunner.dumpAsText(); |
| 5 testRunner.waitUntilDone(); |
| 6 } |
| 7 |
| 8 // The common case is to have four sub-tests. To override |
| 9 // for a test, assign window.test_count. |
| 10 var default_test_count = 4; |
| 11 |
| 12 var event_count = 0; |
| 13 test_count = window.test_count || default_test_count; |
| 14 |
| 15 function finish(pass, msg) { |
| 16 var out = document.querySelector("pre"); |
| 17 var txt = pass ? "PASS" : "FAIL"; |
| 18 if (msg) txt += ": " + msg; |
| 19 out.appendChild(document.createTextNode(txt)); |
| 20 out.appendChild(document.createElement("br")); |
| 21 if (++event_count >= test_count && window.testRunner) |
| 22 testRunner.notifyDone(); |
| 23 } |
| 24 |
| 25 function pass() { finish(true); } |
| 26 function fail() { finish(false); } |
OLD | NEW |