| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A simple unit test library for running tests in a browser. | 6 * A simple unit test library for running tests in a browser. |
| 7 */ | 7 */ |
| 8 #library('unittest'); | 8 #library('unittest'); |
| 9 | 9 |
| 10 #import('dart:html'); | 10 #import('dart:html'); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 void onStart() { | 31 void onStart() { |
| 32 window.postMessage('unittest-suite-wait-for-done', '*'); | 32 window.postMessage('unittest-suite-wait-for-done', '*'); |
| 33 // Listen for uncaught errors. | 33 // Listen for uncaught errors. |
| 34 window.on.error.add(_onErrorClosure); | 34 window.on.error.add(_onErrorClosure); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void onTestResult(TestCase testCase) {} | 37 void onTestResult(TestCase testCase) {} |
| 38 | 38 |
| 39 void onDone(int passed, int failed, int errors, List<TestCase> results) { | 39 void onDone(int passed, int failed, int errors, List<TestCase> results, |
| 40 String uncaughtError) { |
| 40 window.on.error.remove(_onErrorClosure); | 41 window.on.error.remove(_onErrorClosure); |
| 41 _showResultsInPage(passed, failed, errors, results, _isLayoutTest); | 42 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, |
| 43 uncaughtError); |
| 42 window.postMessage('unittest-suite-done', '*'); | 44 window.postMessage('unittest-suite-done', '*'); |
| 43 } | 45 } |
| 44 } | 46 } |
| 45 | 47 |
| 46 void useHtmlConfiguration([bool isLayoutTest = false]) { | 48 void useHtmlConfiguration([bool isLayoutTest = false]) { |
| 47 configure(new HtmlConfiguration(isLayoutTest)); | 49 configure(new HtmlConfiguration(isLayoutTest)); |
| 48 } | 50 } |
| OLD | NEW |