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

Unified Diff: dart/pkg/unittest/test_controller.js

Issue 10919098: Run dart2js tests unmodified in browser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 months 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: dart/pkg/unittest/test_controller.js
diff --git a/dart/pkg/unittest/test_controller.js b/dart/pkg/unittest/test_controller.js
index ce7a8f0d469ee10bf7536939d94ac0f251a8dd78..0be04fbae10f41cedaaf7e8ddce2e8fe6a5abd1e 100644
--- a/dart/pkg/unittest/test_controller.js
+++ b/dart/pkg/unittest/test_controller.js
@@ -75,3 +75,19 @@ document.onreadystatechange = function() {
}, 0);
}, 50);
};
+
+function dartMainRunner(main) {
+ var caughtError;
+ function handleError(e) { caughtError = e; }
+
+ window.postMessage('unittest-suite-wait-for-done', '*');
+ window.addEventListener('error', handleError, false);
+ main();
kasperl 2012/09/06 10:29:29 We have had issues with uncaught JavaScript except
ahe 2012/09/08 13:32:32 I think that is handled by 'window.addEventListene
+ window.removeEventListener('error', handleError, false);
+ if (typeof caughtError != 'undefined') {
+ document.body.innerHTML = String(caughtError);
+ } else {
+ document.body.innerHTML = "PASS";
+ }
+ window.postMessage('unittest-suite-done', '*');
+}

Powered by Google App Engine
This is Rietveld 408576698