| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library runtime_configuration; | 5 library runtime_configuration; |
| 6 | 6 |
| 7 import 'dart:io' show Directory, File; | 7 import 'dart:io' show Directory, File; |
| 8 | 8 |
| 9 import 'compiler_configuration.dart' show CommandArtifact; | 9 import 'compiler_configuration.dart' show CommandArtifact; |
| 10 | 10 |
| 11 // TODO(ahe): Remove this import, we can precompute all the values required | 11 // TODO(ahe): Remove this import, we can precompute all the values required |
| 12 // from TestSuite once the refactoring is complete. | 12 // from TestSuite once the refactoring is complete. |
| 13 import 'test_suite.dart' show TestSuite, TestUtils; | 13 import 'test_suite.dart' show TestSuite, TestUtils; |
| 14 | 14 |
| 15 import 'test_runner.dart' show Command, CommandBuilder; | 15 import 'test_runner.dart' show Command, CommandBuilder; |
| 16 | 16 |
| 17 /// Describes the commands to run a given test case or its compiled output. | 17 /// Describes the commands to run a given test case or its compiled output. |
| 18 /// | 18 /// |
| 19 /// A single runtime configuration object exists per test suite, and is thus | 19 /// A single runtime configuration object exists per test suite, and is thus |
| 20 /// shared between multiple test cases, it should not be mutated after | 20 /// shared between multiple test cases, it should not be mutated after |
| 21 /// construction. | 21 /// construction. |
| 22 // | 22 // |
| 23 // TODO(ahe): I expect this class will become abstract very soon. | 23 // TODO(ahe): I expect this class will become abstract very soon. |
| 24 class RuntimeConfiguration { | 24 class RuntimeConfiguration { |
| 25 // TODO(ahe): Remove this constructor and move the switch to | 25 // TODO(ahe): Remove this constructor and move the switch to |
| 26 // test_options.dart. We probably want to store an instance of | 26 // test_options.dart. We probably want to store an instance of |
| 27 // [RuntimeConfiguration] in [configuration] there. | 27 // [RuntimeConfiguration] in [configuration] there. |
| 28 factory RuntimeConfiguration(Map configuration) { | 28 factory RuntimeConfiguration(Map<String, dynamic> configuration) { |
| 29 String runtime = configuration['runtime']; | 29 String runtime = configuration['runtime']; |
| 30 bool useBlobs = configuration['use_blobs']; | 30 bool useBlobs = configuration['use_blobs']; |
| 31 | 31 |
| 32 switch (runtime) { | 32 switch (runtime) { |
| 33 case 'ContentShellOnAndroid': | 33 case 'ContentShellOnAndroid': |
| 34 case 'DartiumOnAndroid': | 34 case 'DartiumOnAndroid': |
| 35 case 'chrome': | 35 case 'chrome': |
| 36 case 'chromeOnAndroid': | 36 case 'chromeOnAndroid': |
| 37 case 'dartium': | 37 case 'dartium': |
| 38 case 'ff': | 38 case 'ff': |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { | 357 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { |
| 358 List<Command> computeRuntimeCommands( | 358 List<Command> computeRuntimeCommands( |
| 359 TestSuite suite, | 359 TestSuite suite, |
| 360 CommandBuilder commandBuilder, | 360 CommandBuilder commandBuilder, |
| 361 CommandArtifact artifact, | 361 CommandArtifact artifact, |
| 362 List<String> arguments, | 362 List<String> arguments, |
| 363 Map<String, String> environmentOverrides) { | 363 Map<String, String> environmentOverrides) { |
| 364 throw "Unimplemented runtime '$runtimeType'"; | 364 throw "Unimplemented runtime '$runtimeType'"; |
| 365 } | 365 } |
| 366 } | 366 } |
| OLD | NEW |