OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 * This configuration can be used to rerun selected tests, as well | 6 * This configuration can be used to rerun selected tests, as well |
7 * as see diagnostic output from tests. It runs each test in its own | 7 * as see diagnostic output from tests. It runs each test in its own |
8 * IFrame, so the configuration consists of two parts - a 'parent' | 8 * IFrame, so the configuration consists of two parts - a 'parent' |
9 * config that manages all the tests, and a 'child' config for the | 9 * config that manages all the tests, and a 'child' config for the |
10 * IFrame that runs the individual tests. | 10 * IFrame that runs the individual tests. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 super.onTestResult(testCase); | 153 super.onTestResult(testCase); |
154 Date end = new Date.now(); | 154 Date end = new Date.now(); |
155 int elapsed = end.difference(_testStarts[testCase.id]).inMilliseconds; | 155 int elapsed = end.difference(_testStarts[testCase.id]).inMilliseconds; |
156 if (testCase.stackTrace != null) { | 156 if (testCase.stackTrace != null) { |
157 parentWindow.postMessage( | 157 parentWindow.postMessage( |
158 _Message.text(_Message.STACK, elapsed, testCase.stackTrace), '*'); | 158 _Message.text(_Message.STACK, elapsed, testCase.stackTrace), '*'); |
159 } | 159 } |
160 parentWindow.postMessage( | 160 parentWindow.postMessage( |
161 _Message.text(testCase.result, elapsed, testCase.message), '*'); | 161 _Message.text(testCase.result, elapsed, testCase.message), '*'); |
162 } | 162 } |
| 163 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
| 164 String uncaughtError) { |
| 165 } |
163 | 166 |
164 void onDone(int passed, int failed, int errors, List<TestCase> results, | 167 void onDone(bool success) { |
165 String uncaughtError) { | |
166 _uninstallErrorHandler(); | 168 _uninstallErrorHandler(); |
167 } | 169 } |
168 } | 170 } |
169 | 171 |
170 /** | 172 /** |
171 * The parent configuration runs in the top-level window; it wraps the tests | 173 * The parent configuration runs in the top-level window; it wraps the tests |
172 * in new functions that create child IFrames and run the real tests. | 174 * in new functions that create child IFrames and run the real tests. |
173 */ | 175 */ |
174 class ParentInteractiveHtmlConfiguration extends HtmlConfiguration { | 176 class ParentInteractiveHtmlConfiguration extends HtmlConfiguration { |
175 Map<int,Date> _testStarts; | 177 Map<int,Date> _testStarts; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 testItem.classes.remove('status-pending'); | 402 testItem.classes.remove('status-pending'); |
401 testItem.classes.add(result); | 403 testItem.classes.add(result); |
402 // hide the actions | 404 // hide the actions |
403 var actions = testItem.query('.test-actions'); | 405 var actions = testItem.query('.test-actions'); |
404 for (Element e in actions.nodes) { | 406 for (Element e in actions.nodes) { |
405 e.classes.add(result); | 407 e.classes.add(result); |
406 } | 408 } |
407 actions.style.display = 'none'; | 409 actions.style.display = 'none'; |
408 } | 410 } |
409 | 411 |
410 void onDone(int passed, int failed, int errors, List<TestCase> results, | 412 void onSummary(int passed, int failed, int errors, List<TestCase> results, |
411 String uncaughtError) { | 413 String uncaughtError) { |
| 414 } |
| 415 |
| 416 void onDone(bool success) { |
412 window.on.message.remove(_messageHandler); | 417 window.on.message.remove(_messageHandler); |
413 _uninstallErrorHandler(); | 418 _uninstallErrorHandler(); |
414 document.query('#busy').style.display = 'none'; | 419 document.query('#busy').style.display = 'none'; |
415 InputElement startButton = document.query('#start'); | 420 InputElement startButton = document.query('#start'); |
416 startButton.disabled = false; | 421 startButton.disabled = false; |
417 } | 422 } |
418 } | 423 } |
419 | 424 |
420 /** | 425 /** |
421 * Add the divs to the DOM if they are not present. We have a 'controls' | 426 * Add the divs to the DOM if they are not present. We have a 'controls' |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 display: block; | 669 display: block; |
665 list-style-type: disc; | 670 list-style-type: disc; |
666 -webkit-margin-before: 1em; | 671 -webkit-margin-before: 1em; |
667 -webkit-margin-after: 1em; | 672 -webkit-margin-after: 1em; |
668 -webkit-margin-start: 0px; | 673 -webkit-margin-start: 0px; |
669 -webkit-margin-end: 0px; | 674 -webkit-margin-end: 0px; |
670 -webkit-padding-start: 40px; | 675 -webkit-padding-start: 40px; |
671 } | 676 } |
672 | 677 |
673 """; | 678 """; |
OLD | NEW |