summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/js/resources/js-test-pre.js
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/js/resources/js-test-pre.js')
-rw-r--r--LayoutTests/fast/js/resources/js-test-pre.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js
index aaab749..87db5d4 100644
--- a/LayoutTests/fast/js/resources/js-test-pre.js
+++ b/LayoutTests/fast/js/resources/js-test-pre.js
@@ -280,3 +280,16 @@ function gc() {
gcRec(10)
}
}
+
+// It's possible for an async test to call finishJSTest() before js-test-post.js
+// has been parsed.
+function finishJSTest()
+{
+ wasFinishJSTestCalled = true;
+ if (!window.wasPostTestScriptParsed)
+ return;
+ shouldBeTrue("successfullyParsed");
+ debug('<br /><span class="pass">TEST COMPLETE</span>');
+ if (window.jsTestIsAsync && window.layoutTestController)
+ layoutTestController.notifyDone();
+}