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 * Provides enhanced HTML output with collapsible group headers | 8 * Provides enhanced HTML output with collapsible group headers |
9 * and other at-a-glance information about the test results. | 9 * and other at-a-glance information about the test results. |
10 */ | 10 */ |
11 library unittest_html_enhanced_config; | 11 library unittest_html_enhanced_config; |
12 | 12 |
13 import 'dart:async'; | 13 import 'dart:async'; |
14 import 'dart:collection' show LinkedHashMap; | 14 import 'dart:collection' show LinkedHashMap; |
15 import 'dart:html'; | 15 import 'dart:html'; |
16 import 'unittest.dart'; | 16 import 'unittest.dart'; |
17 | 17 |
18 class HtmlEnhancedConfiguration extends Configuration { | 18 class HtmlEnhancedConfiguration extends SimpleConfiguration { |
19 /** Whether this is run within dartium layout tests. */ | 19 /** Whether this is run within dartium layout tests. */ |
20 final bool _isLayoutTest; | 20 final bool _isLayoutTest; |
21 HtmlEnhancedConfiguration(this._isLayoutTest); | 21 HtmlEnhancedConfiguration(this._isLayoutTest); |
22 | 22 |
23 var _onErrorSubscription = null; | 23 var _onErrorSubscription = null; |
24 var _onMessageSubscription = null; | 24 var _onMessageSubscription = null; |
25 | 25 |
26 void _installOnErrorHandler() { | 26 void _installOnErrorHandler() { |
27 if (_onErrorSubscription == null) { | 27 if (_onErrorSubscription == null) { |
28 // Listen for uncaught errors. | 28 // Listen for uncaught errors. |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 '''; | 418 '''; |
419 } | 419 } |
420 | 420 |
421 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { | 421 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { |
422 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; | 422 unittestConfiguration = isLayoutTest ? _singletonLayout : _singletonNotLayout; |
423 } | 423 } |
424 | 424 |
425 final _singletonLayout = new HtmlEnhancedConfiguration(true); | 425 final _singletonLayout = new HtmlEnhancedConfiguration(true); |
426 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); | 426 final _singletonNotLayout = new HtmlEnhancedConfiguration(false); |
OLD | NEW |