| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 final String _CSSID = '_unittestcss_'; | 59 final String _CSSID = '_unittestcss_'; |
| 60 | 60 |
| 61 var cssElement = document.head.query('#${_CSSID}'); | 61 var cssElement = document.head.query('#${_CSSID}'); |
| 62 if (cssElement == null){ | 62 if (cssElement == null){ |
| 63 document.head.elements.add(new Element.html( | 63 document.head.elements.add(new Element.html( |
| 64 '<style id="${_CSSID}"></style>')); | 64 '<style id="${_CSSID}"></style>')); |
| 65 cssElement = document.head.query('#${_CSSID}'); | 65 cssElement = document.head.query('#${_CSSID}'); |
| 66 } | 66 } |
| 67 | 67 |
| 68 cssElement.innerHtml = _htmlTestCSS; | 68 cssElement.innerHtml = _htmlTestCSS; |
| 69 window.postMessage('unittest-suite-wait-for-done', '*'); |
| 69 } | 70 } |
| 70 | 71 |
| 71 void onStart() { | 72 void onStart() { |
| 72 window.postMessage('unittest-suite-wait-for-done', '*'); | |
| 73 // Listen for uncaught errors. | 73 // Listen for uncaught errors. |
| 74 window.on.error.add(_onErrorClosure); | 74 window.on.error.add(_onErrorClosure); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void onTestResult(TestCase testCase) {} | 77 void onTestResult(TestCase testCase) {} |
| 78 | 78 |
| 79 void onDone(int passed, int failed, int errors, List<TestCase> results, | 79 void onDone(int passed, int failed, int errors, List<TestCase> results, |
| 80 String uncaughtError) { | 80 String uncaughtError) { |
| 81 _uninstallHandlers(); | 81 _uninstallHandlers(); |
| 82 | 82 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 .unittest-row-description | 406 .unittest-row-description |
| 407 { | 407 { |
| 408 } | 408 } |
| 409 | 409 |
| 410 '''; | 410 '''; |
| 411 } | 411 } |
| 412 | 412 |
| 413 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { | 413 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { |
| 414 configure(new HtmlEnhancedConfiguration(isLayoutTest)); | 414 configure(new HtmlEnhancedConfiguration(isLayoutTest)); |
| 415 } | 415 } |
| OLD | NEW |