Index: LayoutTests/fast/harness/expected-error-in-async-test.html |
diff --git a/LayoutTests/fast/harness/expected-error-in-async-test.html b/LayoutTests/fast/harness/expected-error-in-async-test.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..239f47e82f3171dc7c292b82f1942c10c9453216 |
--- /dev/null |
+++ b/LayoutTests/fast/harness/expected-error-in-async-test.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE html> |
+ |
+<script src="../../resources/js-test.js"></script> |
+<script> |
+description('Test that the window.onerror handler in resources/js-test.js ' + |
+ 'stops asynchronous tests'); |
+ |
+function errorThrower() |
+{ |
+ debug("Throwing an expected error"); |
+ throw new Error("An expected error"); |
+} |
+ |
+function errorExpecter() |
+{ |
+ shouldHaveHadError("expected error"); |
+ finishJSTest(); |
+} |
+ |
+window.jsTestIsAsync = true; |
+debug("Will throw an error soon"); |
+expectError(); |
+setTimeout(errorThrower, 20); |
+setTimeout(errorExpecter, 40); |
+</script> |
+ |