Chromium Code Reviews| 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 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 String directoryPath; | 193 String directoryPath; |
| 194 List<String> statusFilePaths; | 194 List<String> statusFilePaths; |
| 195 Function doTest; | 195 Function doTest; |
| 196 Function doDone; | 196 Function doDone; |
| 197 int activeTestGenerators = 0; | 197 int activeTestGenerators = 0; |
| 198 bool listingDone = false; | 198 bool listingDone = false; |
| 199 TestExpectations testExpectations; | 199 TestExpectations testExpectations; |
| 200 List<TestInformation> cachedTests; | 200 List<TestInformation> cachedTests; |
| 201 final String dartDir; | 201 final String dartDir; |
| 202 Function globalTemporaryDirectory; | 202 Function globalTemporaryDirectory; |
| 203 /** | |
| 204 * Reference to our test queue, so that we can notify the queue if it needs | |
| 205 * to run any cleanup after the suite completes. | |
| 206 */ | |
| 207 ProcessQueue _allDoneCallbackListener; | |
| 203 | 208 |
| 204 StandardTestSuite(Map this.configuration, | 209 StandardTestSuite(Map this.configuration, |
| 205 String this.suiteName, | 210 String this.suiteName, |
| 206 String this.directoryPath, | 211 String this.directoryPath, |
| 207 List<String> this.statusFilePaths) | 212 List<String> this.statusFilePaths) |
| 208 : dartDir = TestUtils.dartDir(); | 213 : dartDir = TestUtils.dartDir(); |
| 209 | 214 |
| 210 /** | 215 /** |
| 211 * The default implementation assumes a file is a test if | 216 * The default implementation assumes a file is a test if |
| 212 * it ends in "Test.dart". | 217 * it ends in "Test.dart". |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 557 var testCase = new BrowserTestCase( | 562 var testCase = new BrowserTestCase( |
| 558 testName, | 563 testName, |
| 559 compilerExecutable, | 564 compilerExecutable, |
| 560 compilerArgs, | 565 compilerArgs, |
| 561 'python', | 566 'python', |
| 562 args, | 567 args, |
| 563 configuration, | 568 configuration, |
| 564 completeHandler, | 569 completeHandler, |
| 565 expectations, | 570 expectations, |
| 566 optionsFromFile['isNegative']); | 571 optionsFromFile['isNegative']); |
| 572 if ((_allDoneCallbackListener != null)) { | |
|
Jennifer Messerly
2012/02/14 02:17:25
extra parens
Emily Fortuna
2012/02/14 23:55:44
Done.
| |
| 573 _allDoneCallbackListener.browserUsed = configuration['browser']; | |
| 574 } | |
| 567 doTest(testCase); | 575 doTest(testCase); |
| 568 } | 576 } |
| 569 } | 577 } |
| 570 | 578 |
| 579 /** | |
| 580 * Notify the process queue that once all the tests have completed, we need | |
| 581 * to run a process to clean up any bad state that WebDriver may have left | |
| 582 * (extra browser processes, etc). | |
| 583 */ | |
| 584 void notifyIfBrowserCleanupNeeded(ProcessQueue queue) { | |
| 585 _allDoneCallbackListener = queue; | |
| 586 } | |
| 587 | |
| 571 bool get requiresCleanTemporaryDirectory() => | 588 bool get requiresCleanTemporaryDirectory() => |
| 572 configuration['component'] == 'dartc' || | 589 configuration['component'] == 'dartc' || |
| 573 configuration['component'] == 'chromium'; | 590 configuration['component'] == 'chromium'; |
| 574 | 591 |
| 575 /** | 592 /** |
| 576 * Create a directory for the generated test. If a Dart language test | 593 * Create a directory for the generated test. If a Dart language test |
| 577 * needs to be run in a browser, the Dart test needs to be embedded in | 594 * needs to be run in a browser, the Dart test needs to be embedded in |
| 578 * an HTML page, with a testing framework based on scripting and DOM events. | 595 * an HTML page, with a testing framework based on scripting and DOM events. |
| 579 * These scripts and pages are written to a generated_test directory, | 596 * These scripts and pages are written to a generated_test directory, |
| 580 * usually inside the build directory of the checkout. | 597 * usually inside the build directory of the checkout. |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1124 * $noCrash tests are expected to be flaky but not crash | 1141 * $noCrash tests are expected to be flaky but not crash |
| 1125 * $pass tests are expected to pass | 1142 * $pass tests are expected to pass |
| 1126 * $failOk tests are expected to fail that we won't fix | 1143 * $failOk tests are expected to fail that we won't fix |
| 1127 * $fail tests are expected to fail that we should fix | 1144 * $fail tests are expected to fail that we should fix |
| 1128 * $crash tests are expected to crash that we should fix | 1145 * $crash tests are expected to crash that we should fix |
| 1129 * $timeout tests are allowed to timeout | 1146 * $timeout tests are allowed to timeout |
| 1130 """; | 1147 """; |
| 1131 print(report); | 1148 print(report); |
| 1132 } | 1149 } |
| 1133 } | 1150 } |
| OLD | NEW |