Chromium Code Reviews| Index: tools/testing/dart/test_runner.dart |
| =================================================================== |
| --- tools/testing/dart/test_runner.dart (revision 24075) |
| +++ tools/testing/dart/test_runner.dart (working copy) |
| @@ -17,7 +17,6 @@ |
| // CommandOutput.exitCode in subclasses of CommandOutput. |
| import "dart:io" as io; |
| import "dart:isolate"; |
| -import "dart:uri"; |
| import "browser_controller.dart"; |
| import "http_server.dart" as http_server; |
| import "status_file_parser.dart"; |
| @@ -122,7 +121,7 @@ |
| String toString() => commandLine; |
| - Future<bool> get outputIsUpToDate => new Future.immediate(false); |
| + Future<bool> get outputIsUpToDate => new Future.value(false); |
| io.Path get expectedOutputFile => null; |
| bool get isPixelTest => false; |
| } |
| @@ -140,19 +139,19 @@ |
| : super(executable, arguments); |
| Future<bool> get outputIsUpToDate { |
| - if (_neverSkipCompilation) return new Future.immediate(false); |
| + if (_neverSkipCompilation) return new Future.value(false); |
| Future<List<Uri>> readDepsFile(String path) { |
| var file = new io.File(new io.Path(path).toNativePath()); |
| if (!file.existsSync()) { |
| - return new Future.immediate(null); |
| + return new Future.value(null); |
| } |
| return file.readAsLines().then((List<String> lines) { |
| var dependencies = new List<Uri>(); |
| for (var line in lines) { |
| line = line.trim(); |
| if (line.length > 0) { |
| - dependencies.add(new Uri(line)); |
| + dependencies.add(Uri.parse(line)); |
| } |
| } |
| return dependencies; |
| @@ -163,7 +162,7 @@ |
| if (dependencies != null) { |
| dependencies.addAll(_bootstrapDependencies); |
| var jsOutputLastModified = TestUtils.lastModifiedCache.getLastModified( |
| - new Uri.fromComponents(scheme: 'file', path: _outputFile)); |
| + new Uri(scheme: 'file', path: _outputFile)); |
| if (jsOutputLastModified != null) { |
| for (var dependency in dependencies) { |
| var dependencyLastModified = |
| @@ -1028,12 +1027,13 @@ |
| compilationSkipped = true; |
| _commandComplete(0); |
| } else { |
| - var processOptions = _createProcessOptions(); |
| + var processEnvironment = _createProcessEnvironment(); |
| var commandArguments = _modifySeleniumTimeout(command.arguments, |
| testCase.timeout); |
| - Future processFuture = io.Process.start(command.executable, |
| - commandArguments, |
| - processOptions); |
| + Future processFuture = |
| + io.Process.start(command.executable, |
| + commandArguments, |
| + environment: processEnvironment); |
| processFuture.then((io.Process process) { |
| // Close stdin so that tests that try to block on input will fail. |
| process.stdin.close(); |
| @@ -1087,19 +1087,18 @@ |
| source.listen(destination.addAll); |
| } |
| - io.ProcessOptions _createProcessOptions() { |
| + Map<String, String> _createProcessEnvironment() { |
| var baseEnvironment = command.environment != null ? |
| command.environment : io.Platform.environment; |
| - io.ProcessOptions options = new io.ProcessOptions(); |
| - options.environment = new Map<String, String>.from(baseEnvironment); |
| - options.environment['DART_CONFIGURATION'] = |
| + var environment = new Map<String, String>.from(baseEnvironment); |
| + environment['DART_CONFIGURATION'] = |
| TestUtils.configurationDir(testCase.configuration); |
| for (var excludedEnvironmentVariable in EXCLUDED_ENVIRONMENT_VARIABLES) { |
| - options.environment.remove(excludedEnvironmentVariable); |
| + environment.remove(excludedEnvironmentVariable); |
| } |
| - return options; |
| + return environment; |
| } |
| } |
| @@ -1159,7 +1158,7 @@ |
| } |
| Future terminate() { |
| - if (_process == null) return new Future.immediate(true); |
| + if (_process == null) return new Future.value(true); |
| Completer completer = new Completer(); |
| Timer killTimer; |
| _processExitHandler = (_) { |
| @@ -1423,6 +1422,10 @@ |
| } |
| void _runTests(List<TestSuite> testSuites) { |
| + var allSuites = []..addAll(testSuites); |
| + allSuites.addAll(testSuites); |
| + |
| + testSuites = allSuites; |
|
kustermann
2013/06/17 09:38:38
Please remove these lines.
ricow1
2013/06/17 09:42:47
Done.
|
| var newTest; |
| var allTestsKnown; |
| @@ -1663,14 +1666,14 @@ |
| io.exit(1); |
| }); |
| } |
| - return new Future.immediate(_browserTestRunners[runtime]); |
| + return new Future.value(_browserTestRunners[runtime]); |
| } |
| void _startBrowserControllerTest(var test) { |
| var callback = (var output, var duration) { |
| var nextCommandIndex = test.commandOutputs.keys.length; |
| new CommandOutput.fromCase(test, |
| - test.commands[nextCommandIndex], |
| + test.commands.last, |
|
kustermann
2013/06/17 09:38:38
Please revert this change.
ricow1
2013/06/17 09:42:47
Done.
|
| 0, |
| false, |
| output == "TIMEOUT", |