| 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:html'); | 10 import 'dart:html'; |
| 11 #import('unittest.dart'); | 11 import 'unittest.dart'; |
| 12 | 12 |
| 13 #source('html_print.dart'); | 13 part 'html_print.dart'; |
| 14 | 14 |
| 15 class HtmlConfiguration extends Configuration { | 15 class HtmlConfiguration extends Configuration { |
| 16 /** Whether this is run within dartium layout tests. */ | 16 /** Whether this is run within dartium layout tests. */ |
| 17 final bool _isLayoutTest; | 17 final bool _isLayoutTest; |
| 18 HtmlConfiguration(this._isLayoutTest); | 18 HtmlConfiguration(this._isLayoutTest); |
| 19 | 19 |
| 20 // TODO(rnystrom): Get rid of this if we get canonical closures for methods. | 20 // TODO(rnystrom): Get rid of this if we get canonical closures for methods. |
| 21 EventListener _onErrorClosure; | 21 EventListener _onErrorClosure; |
| 22 EventListener _onMessageClosure; | 22 EventListener _onMessageClosure; |
| 23 | 23 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 _uninstallHandlers(); | 67 _uninstallHandlers(); |
| 68 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, | 68 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, |
| 69 uncaughtError); | 69 uncaughtError); |
| 70 window.postMessage('unittest-suite-done', '*'); | 70 window.postMessage('unittest-suite-done', '*'); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 void useHtmlConfiguration([bool isLayoutTest = false]) { | 74 void useHtmlConfiguration([bool isLayoutTest = false]) { |
| 75 configure(new HtmlConfiguration(isLayoutTest)); | 75 configure(new HtmlConfiguration(isLayoutTest)); |
| 76 } | 76 } |
| OLD | NEW |