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..9b6a36523cba978ac0fa544eb0aa73e0731ac54e |
--- /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, 0); |
+</script> |