| 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 * 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 */ |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 if (_onErrorClosure != null) { | 41 if (_onErrorClosure != null) { |
| 42 window.on.error.remove(_onErrorClosure); | 42 window.on.error.remove(_onErrorClosure); |
| 43 _onErrorClosure = null; | 43 _onErrorClosure = null; |
| 44 } | 44 } |
| 45 if (_onMessageClosure != null) { | 45 if (_onMessageClosure != null) { |
| 46 window.on.message.remove(_onMessageClosure); | 46 window.on.message.remove(_onMessageClosure); |
| 47 _onMessageClosure = null; | 47 _onMessageClosure = null; |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 void processMessage(e) { |
| 52 if ('unittest-suite-external-error' == e.data) { |
| 53 handleExternalError('<unknown>', '(external error detected)'); |
| 54 } |
| 55 } |
| 56 |
| 51 void onInit() { | 57 void onInit() { |
| 52 _installHandlers(); | 58 _installHandlers(); |
| 53 //initialize and load CSS | 59 //initialize and load CSS |
| 54 final String _CSSID = '_unittestcss_'; | 60 final String _CSSID = '_unittestcss_'; |
| 55 | 61 |
| 56 var cssElement = document.head.query('#${_CSSID}'); | 62 var cssElement = document.head.query('#${_CSSID}'); |
| 57 if (cssElement == null){ | 63 if (cssElement == null){ |
| 58 document.head.elements.add(new Element.html( | 64 document.head.elements.add(new Element.html( |
| 59 '<style id="${_CSSID}"></style>')); | 65 '<style id="${_CSSID}"></style>')); |
| 60 cssElement = document.head.query('#${_CSSID}'); | 66 cssElement = document.head.query('#${_CSSID}'); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 .unittest-row-description | 403 .unittest-row-description |
| 398 { | 404 { |
| 399 } | 405 } |
| 400 | 406 |
| 401 '''; | 407 '''; |
| 402 } | 408 } |
| 403 | 409 |
| 404 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { | 410 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { |
| 405 configure(new HtmlEnhancedConfiguration(isLayoutTest)); | 411 configure(new HtmlEnhancedConfiguration(isLayoutTest)); |
| 406 } | 412 } |
| OLD | NEW |