Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Unified Diff: LayoutTests/fast/harness/error-in-async-test.html

Issue 59903016: LayoutTests/resources/js-test.js onerror tweak. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed setTimeout from js-tests changes. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698