Chromium Code Reviews| 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', '*'); |
| +} |