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

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

Issue 2875203005: Refactor and clean up the status file parsing code. (Closed)
Patch Set: Dartfmt. Created 3 years, 7 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/expectation_set.dart ('k') | tools/testing/dart/status_expression.dart » ('j') | 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) 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
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 }
OLDNEW
« no previous file with comments | « tools/testing/dart/expectation_set.dart ('k') | tools/testing/dart/status_expression.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698