| Index: lib/unittest/html_enhanced_config.dart
|
| diff --git a/lib/unittest/html_enhanced_config.dart b/lib/unittest/html_enhanced_config.dart
|
| index 1bdf924ea492f2e66c8db842e2f09142edc2761c..7b611c76f3e6c5b6573f0d716c48e4e1c533baa6 100644
|
| --- a/lib/unittest/html_enhanced_config.dart
|
| +++ b/lib/unittest/html_enhanced_config.dart
|
| @@ -38,7 +38,7 @@ class HtmlEnhancedConfiguration extends Configuration {
|
| _onErrorClosure = (e) {
|
| // TODO(vsm): figure out how to expose the stack trace here
|
| // Currently e.message works in dartium, but not in dartc.
|
| - notifyError('(DOM callback has errors) Caught ${e}', '');
|
| + reportTestError('(DOM callback has errors) Caught ${e}', '');
|
| };
|
| }
|
|
|
| @@ -50,17 +50,18 @@ class HtmlEnhancedConfiguration extends Configuration {
|
|
|
| void onTestResult(TestCase testCase) {}
|
|
|
| - void onDone(int passed, int failed, int errors, List<TestCase> results) {
|
| + void onDone(int passed, int failed, int errors, List<TestCase> results,
|
| + String uncaughtError) {
|
| window.on.error.remove(_onErrorClosure);
|
|
|
| _showInteractiveResultsInPage(passed, failed, errors, results,
|
| - _isLayoutTest);
|
| + _isLayoutTest, uncaughtError);
|
|
|
| window.postMessage('unittest-suite-done', '*');
|
| }
|
|
|
| void _showInteractiveResultsInPage(int passed, int failed, int errors,
|
| - List<TestCase> results, bool isLayoutTest){
|
| + List<TestCase> results, bool isLayoutTest, String uncaughtError) {
|
| if (isLayoutTest && passed == results.length) {
|
| document.body.innerHTML = "PASS";
|
| } else {
|
| @@ -73,17 +74,25 @@ class HtmlEnhancedConfiguration extends Configuration {
|
|
|
| // moved summary to the top since web browsers
|
| // don't auto-scroll to the bottom like consoles typically do.
|
| - if (passed == results.length) {
|
| + if (passed == results.length && uncaughtError == null) {
|
| te.elements.add(new Element.html("""
|
| <div class='unittest-pass'>All ${passed} tests passed</div>"""));
|
| } else {
|
|
|
| + if (uncaughtError != null) {
|
| + te.elements.add(new Element.html("""
|
| + <div class='unittest-summary'>
|
| + <span class='unittest-error'>Uncaught error: $uncaughtError</span>
|
| + </div>"""));
|
| + }
|
| +
|
| te.elements.add(new Element.html("""
|
| - <div class='unittest-summary'>
|
| - <span class='unittest-pass'>Total ${passed} passed</span>,
|
| - <span class='unittest-fail'>${failed} failed</span>,
|
| - <span class='unittest-error'>${errors} errors</span>
|
| - </div>"""));
|
| + <div class='unittest-summary'>
|
| + <span class='unittest-pass'>Total ${passed} passed</span>,
|
| + <span class='unittest-fail'>${failed} failed</span>,
|
| + <span class='unittest-error'>
|
| + ${errors + (uncaughtError == null ? 0 : 1)} errors</span>
|
| + </div>"""));
|
| }
|
|
|
| te.elements.add(new Element.html("""
|
|
|