Chromium Code Reviews| 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'; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 } | 119 } |
| 120 | 120 |
| 121 void processMessage(e) { | 121 void processMessage(e) { |
| 122 if ('unittest-suite-external-error' == e.data) { | 122 if ('unittest-suite-external-error' == e.data) { |
| 123 handleExternalError('<unknown>', '(external error detected)'); | 123 handleExternalError('<unknown>', '(external error detected)'); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void onInit() { | 127 void onInit() { |
| 128 _installHandlers(); | 128 _installHandlers(); |
| 129 } | |
| 130 | |
| 131 void onStart() { | |
|
Emily Fortuna
2013/01/07 23:32:25
I assume this means we probably need to do the sam
| |
| 132 window.postMessage('unittest-suite-wait-for-done', '*'); | 129 window.postMessage('unittest-suite-wait-for-done', '*'); |
| 133 } | 130 } |
| 134 | 131 |
| 135 void onTestResult(TestCase testCase) {} | 132 void onTestResult(TestCase testCase) {} |
| 136 | 133 |
| 137 void onDone(int passed, int failed, int errors, List<TestCase> results, | 134 void onDone(int passed, int failed, int errors, List<TestCase> results, |
| 138 String uncaughtError) { | 135 String uncaughtError) { |
| 139 _uninstallHandlers(); | 136 _uninstallHandlers(); |
| 140 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, | 137 _showResultsInPage(passed, failed, errors, results, _isLayoutTest, |
| 141 uncaughtError); | 138 uncaughtError); |
| 142 window.postMessage('unittest-suite-done', '*'); | 139 window.postMessage('unittest-suite-done', '*'); |
| 143 } | 140 } |
| 144 } | 141 } |
| 145 | 142 |
| 146 void useHtmlConfiguration([bool isLayoutTest = false]) { | 143 void useHtmlConfiguration([bool isLayoutTest = false]) { |
| 147 configure(new HtmlConfiguration(isLayoutTest)); | 144 configure(new HtmlConfiguration(isLayoutTest)); |
| 148 } | 145 } |
| OLD | NEW |