| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 void onSummary(int passed, int failed, int errors, List<TestCase> results, | 161 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
| 162 String uncaughtError) { | 162 String uncaughtError) { |
| 163 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, | 163 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, |
| 164 uncaughtError); | 164 uncaughtError); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void onDone(bool success) { | 167 void onDone(bool success) { |
| 168 _uninstallHandlers(); | 168 _uninstallHandlers(); |
| 169 window.postMessage( | 169 window.postMessage('unittest-suite-done', '*'); |
| 170 success ? 'unittest-suite-done' : 'unittest-suite-fail', '*'); | |
| 171 } | 170 } |
| 172 } | 171 } |
| 173 | 172 |
| 174 void useHtmlConfiguration([bool isLayoutTest = false]) { | 173 void useHtmlConfiguration([bool isLayoutTest = false]) { |
| 175 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; | 174 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; |
| 176 } | 175 } |
| 177 | 176 |
| 178 final _singletonLayout = new HtmlConfiguration(true); | 177 final _singletonLayout = new HtmlConfiguration(true); |
| 179 final _singletonNotLayout = new HtmlConfiguration(false); | 178 final _singletonNotLayout = new HtmlConfiguration(false); |
| OLD | NEW |