| 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_html_config; | 8 library unittest_html_config; |
| 9 | 9 |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if ('unittest-suite-external-error' == e.data) { | 119 if ('unittest-suite-external-error' == e.data) { |
| 120 handleExternalError('<unknown>', '(external error detected)'); | 120 handleExternalError('<unknown>', '(external error detected)'); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 void onInit() { | 124 void onInit() { |
| 125 _installHandlers(); | 125 _installHandlers(); |
| 126 window.postMessage('unittest-suite-wait-for-done', '*'); | 126 window.postMessage('unittest-suite-wait-for-done', '*'); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void onTestResult(TestCase testCase) {} | |
| 130 | |
| 131 void onSummary(int passed, int failed, int errors, List<TestCase> results, | 129 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
| 132 String uncaughtError) { | 130 String uncaughtError) { |
| 133 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, | 131 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, |
| 134 uncaughtError); | 132 uncaughtError); |
| 135 } | 133 } |
| 136 | 134 |
| 137 void onDone(bool success) { | 135 void onDone(bool success) { |
| 138 _uninstallHandlers(); | 136 _uninstallHandlers(); |
| 139 window.postMessage('unittest-suite-done', '*'); | 137 window.postMessage('unittest-suite-done', '*'); |
| 140 } | 138 } |
| 141 } | 139 } |
| 142 | 140 |
| 143 void useHtmlConfiguration([bool isLayoutTest = false]) { | 141 void useHtmlConfiguration([bool isLayoutTest = false]) { |
| 144 if (config != null) return; | 142 if (config != null) return; |
| 145 configure(new HtmlConfiguration(isLayoutTest)); | 143 configure(new HtmlConfiguration(isLayoutTest)); |
| 146 } | 144 } |
| OLD | NEW |