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 /** This file is sourced by unitest.dart. */ | 5 part of unittest; |
6 | 6 |
7 /** | 7 /** |
8 * Hooks to configure the unittest library for different platforms. This class | 8 * Hooks to configure the unittest library for different platforms. This class |
9 * implements the API in a platform-independent way. Tests that want to take | 9 * implements the API in a platform-independent way. Tests that want to take |
10 * advantage of the platform can create a subclass and override methods from | 10 * advantage of the platform can create a subclass and override methods from |
11 * this class. | 11 * this class. |
12 */ | 12 */ |
| 13 |
13 class Configuration { | 14 class Configuration { |
14 TestCase currentTestCase = null; | 15 TestCase currentTestCase = null; |
15 | 16 |
16 /** | 17 /** |
17 * Subclasses can override this with something useful for diagnostics. | 18 * Subclasses can override this with something useful for diagnostics. |
18 * Particularly useful in cases where we have parent/child configurations | 19 * Particularly useful in cases where we have parent/child configurations |
19 * such as layout tests. | 20 * such as layout tests. |
20 */ | 21 */ |
21 get name => 'Configuration'; | 22 get name => 'Configuration'; |
22 /** | 23 /** |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Currently e.message works in dartium, but not in dartc. | 143 // Currently e.message works in dartium, but not in dartc. |
143 handleExternalError(e, String message) => | 144 handleExternalError(e, String message) => |
144 _reportTestError('$message\nCaught $e', ''); | 145 _reportTestError('$message\nCaught $e', ''); |
145 | 146 |
146 _postMessage(String message) { | 147 _postMessage(String message) { |
147 // In dart2js browser tests, the JavaScript-based test controller | 148 // In dart2js browser tests, the JavaScript-based test controller |
148 // intercepts calls to print and listens for "secret" messages. | 149 // intercepts calls to print and listens for "secret" messages. |
149 print(message); | 150 print(message); |
150 } | 151 } |
151 } | 152 } |
OLD | NEW |