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); } |