Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: tools/testing/dart/test_runner.dart

Issue 1859523002: Start browsers sequentially in testing scripts, as needed. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/testing/dart/browser_controller.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 executing tests. 6 * Classes and methods for executing tests.
7 * 7 *
8 * This module includes: 8 * This module includes:
9 * - Managing parallel execution of tests, including timeout checks. 9 * - Managing parallel execution of tests, including timeout checks.
10 * - Evaluating the output of each test as pass/fail/crash/timeout. 10 * - Evaluating the output of each test as pass/fail/crash/timeout.
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after
2551 2551
2552 BrowserTest browserTest; 2552 BrowserTest browserTest;
2553 if (browserCommand is BrowserHtmlTestCommand) { 2553 if (browserCommand is BrowserHtmlTestCommand) {
2554 browserTest = new HtmlTest(browserCommand.url, callback, timeout, 2554 browserTest = new HtmlTest(browserCommand.url, callback, timeout,
2555 browserCommand.expectedMessages); 2555 browserCommand.expectedMessages);
2556 } else { 2556 } else {
2557 browserTest = new BrowserTest(browserCommand.url, callback, timeout); 2557 browserTest = new BrowserTest(browserCommand.url, callback, timeout);
2558 } 2558 }
2559 _getBrowserTestRunner(browserCommand.browser, browserCommand.configuration) 2559 _getBrowserTestRunner(browserCommand.browser, browserCommand.configuration)
2560 .then((testRunner) { 2560 .then((testRunner) {
2561 testRunner.queueTest(browserTest); 2561 testRunner.enqueueTest(browserTest);
2562 }); 2562 });
2563 2563
2564 return completer.future; 2564 return completer.future;
2565 } 2565 }
2566 2566
2567 Future<BrowserTestRunner> _getBrowserTestRunner(String browser, 2567 Future<BrowserTestRunner> _getBrowserTestRunner(String browser,
2568 Map configuration) { 2568 Map configuration) async {
2569 var localIp = globalConfiguration['local_ip']; 2569 var localIp = globalConfiguration['local_ip'];
2570 var num_browsers = maxBrowserProcesses;
2571 if (_browserTestRunners[configuration] == null) { 2570 if (_browserTestRunners[configuration] == null) {
2572 var testRunner = new BrowserTestRunner( 2571 var testRunner = new BrowserTestRunner(
2573 configuration, localIp, browser, num_browsers); 2572 configuration, localIp, browser, maxBrowserProcesses);
2574 if (globalConfiguration['verbose']) { 2573 if (globalConfiguration['verbose']) {
2575 testRunner.logger = DebugLogger.info; 2574 testRunner.logger = DebugLogger.info;
2576 } 2575 }
2577 _browserTestRunners[configuration] = testRunner; 2576 _browserTestRunners[configuration] = testRunner;
2578 return testRunner.start().then((started) { 2577 await testRunner.start();
2579 if (started) {
2580 return testRunner;
2581 }
2582 print("Issue starting browser test runner");
2583 io.exit(1);
2584 });
2585 } 2578 }
2586 return new Future.value(_browserTestRunners[configuration]); 2579 return _browserTestRunners[configuration];
2587 } 2580 }
2588 } 2581 }
2589 2582
2590 class RecordingCommandExecutor implements CommandExecutor { 2583 class RecordingCommandExecutor implements CommandExecutor {
2591 TestCaseRecorder _recorder; 2584 TestCaseRecorder _recorder;
2592 2585
2593 RecordingCommandExecutor(Path path) 2586 RecordingCommandExecutor(Path path)
2594 : _recorder = new TestCaseRecorder(path); 2587 : _recorder = new TestCaseRecorder(path);
2595 2588
2596 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) { 2589 Future<CommandOutput> runCommand(node, ProcessCommand command, int timeout) {
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
2957 } 2950 }
2958 } 2951 }
2959 2952
2960 void eventAllTestsDone() { 2953 void eventAllTestsDone() {
2961 for (var listener in _eventListener) { 2954 for (var listener in _eventListener) {
2962 listener.allDone(); 2955 listener.allDone();
2963 } 2956 }
2964 _allDone(); 2957 _allDone();
2965 } 2958 }
2966 } 2959 }
OLDNEW
« no previous file with comments | « tools/testing/dart/browser_controller.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698