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

Unified Diff: tools/testing/dart/test_configurations.dart

Issue 1922163002: Initial support to test.dart for running precompiler tests on android devices (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/runtime_configuration.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_configurations.dart
diff --git a/tools/testing/dart/test_configurations.dart b/tools/testing/dart/test_configurations.dart
index ff482734681a67899028ad8e21647f1e3916090e..f8cd209ab16234d45a9c4520304dc603e8ffa91c 100644
--- a/tools/testing/dart/test_configurations.dart
+++ b/tools/testing/dart/test_configurations.dart
@@ -8,6 +8,7 @@ import "dart:async";
import 'dart:io';
import "dart:math" as math;
+import 'android.dart';
import "browser_controller.dart";
import "co19_test_config.dart";
import "http_server.dart";
@@ -49,7 +50,7 @@ final TEST_SUITE_DIRECTORIES = [
new Path('utils/tests/peg'),
];
-void testConfigurations(List<Map> configurations) {
+Future testConfigurations(List<Map> configurations) async {
var startTime = new DateTime.now();
// Extract global options from first configuration.
var firstConf = configurations[0];
@@ -281,26 +282,34 @@ void testConfigurations(List<Map> configurations) {
eventListener.add(new ExitCodeSetter());
}
- void startProcessQueue() {
- // [firstConf] is needed here, since the ProcessQueue needs to know the
- // settings of 'noBatch' and 'local_ip'
- new ProcessQueue(
- firstConf,
- maxProcesses,
- maxBrowserProcesses,
- startTime,
- testSuites,
- eventListener,
- allTestsFinished,
- verbose,
- recordingPath,
- recordingOutputPath);
+ // If any of the configurations need to access android devices we'll first
+ // make a pool of all available adb devices.
+ AdbDevicePool adbDevicePool;
+ bool needsAdbDevicePool = configurations.any((Map conf) {
+ return conf['runtime'] == 'dart_precompiled' &&
+ conf['system'] == 'android';
+ });
+ if (needsAdbDevicePool) {
+ adbDevicePool = await AdbDevicePool.create();
}
// Start all the HTTP servers required before starting the process queue.
- if (serverFutures.isEmpty) {
- startProcessQueue();
- } else {
- Future.wait(serverFutures).then((_) => startProcessQueue());
+ if (!serverFutures.isEmpty) {
+ await Future.wait(serverFutures);
}
+
+ // [firstConf] is needed here, since the ProcessQueue needs to know the
+ // settings of 'noBatch' and 'local_ip'
+ new ProcessQueue(
+ firstConf,
+ maxProcesses,
+ maxBrowserProcesses,
+ startTime,
+ testSuites,
+ eventListener,
+ allTestsFinished,
+ verbose,
+ recordingPath,
+ recordingOutputPath,
+ adbDevicePool);
}
« no previous file with comments | « tools/testing/dart/runtime_configuration.dart ('k') | tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698