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

Unified Diff: pkg/unittest/test_controller.js

Issue 11565018: Avoid timeouts when DRT fails to find a file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | samples/tests/samples/samples.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test_controller.js
diff --git a/pkg/unittest/test_controller.js b/pkg/unittest/test_controller.js
index 5a7db1e824a43ec3157f77c055b49f5ffeb26ddf..5332c190554559ef26e289ff9a5c4727951e0fba 100644
--- a/pkg/unittest/test_controller.js
+++ b/pkg/unittest/test_controller.js
@@ -83,12 +83,17 @@ function onLoad(e) {
window.addEventListener("DOMContentLoaded", onLoad, false);
-// If nobody intercepts the error, finish the test.
-window.addEventListener("error", function(e) {
+// Note: before renaming this function, note that it is also included in an
+// inlined error handler in the HTML files that wrap DRT tests.
+// See: tools/testing/dart/browser_test.dart
+function externalError(e) {
// needed for dartium compilation errors.
showErrorAndExit(e && e.message);
window.postMessage('unittest-suite-external-error', '*');
-}, false);
+}
+
+// If nobody intercepts the error, finish the test.
+window.addEventListener("error", externalError, false);
document.addEventListener('readystatechange', function () {
if (document.readyState != "loaded") return;
« no previous file with comments | « no previous file | samples/tests/samples/samples.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698