Index: LayoutTests/fast/harness/error-in-async-test.html |
diff --git a/LayoutTests/fast/harness/error-in-async-test.html b/LayoutTests/fast/harness/error-in-async-test.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b92cdfe43d1d04c958fc71f00b1148f9bbf69e1a |
--- /dev/null |
+++ b/LayoutTests/fast/harness/error-in-async-test.html |
@@ -0,0 +1,20 @@ |
+<!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 buggyAsyncCode() |
+{ |
+ debug("Simulating an unexpected error"); |
+ |
+ // If the onerror handler doesn't finish async tests, this test will |
+ // timeout, and the line below will not show. |
+ throw new Error("An unexpected error"); |
+} |
+ |
+window.jsTestIsAsync = true; |
+debug("Will throw an error soon"); |
+setTimeout(buggyAsyncCode, 20); |
+</script> |