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

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

Issue 1992703005: Add test harness option for app snapshots with unoptimized code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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 'compiler_configuration.dart' show CommandArtifact; 7 import 'compiler_configuration.dart' show CommandArtifact;
8 8
9 // TODO(ahe): Remove this import, we can precompute all the values required 9 // TODO(ahe): Remove this import, we can precompute all the values required
10 // from TestSuite once the refactoring is complete. 10 // from TestSuite once the refactoring is complete.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 case 'd8': 44 case 'd8':
45 return new D8RuntimeConfiguration(); 45 return new D8RuntimeConfiguration();
46 46
47 case 'none': 47 case 'none':
48 return new NoneRuntimeConfiguration(); 48 return new NoneRuntimeConfiguration();
49 49
50 case 'vm': 50 case 'vm':
51 return new StandaloneDartRuntimeConfiguration(); 51 return new StandaloneDartRuntimeConfiguration();
52 52
53 case 'dart_product': 53 case 'dart_app':
54 return new DartProductRuntimeConfiguration(); 54 return new DartAppRuntimeConfiguration(useBlobs: useBlobs);
55 55
56 case 'dart_precompiled': 56 case 'dart_precompiled':
57 if (configuration['system'] == 'android') { 57 if (configuration['system'] == 'android') {
58 return new DartPrecompiledAdbRuntimeConfiguration(useBlobs: useBlobs); 58 return new DartPrecompiledAdbRuntimeConfiguration(useBlobs: useBlobs);
59 } 59 }
60 return new DartPrecompiledRuntimeConfiguration(useBlobs: useBlobs); 60 return new DartPrecompiledRuntimeConfiguration(useBlobs: useBlobs);
61 61
62 case 'drt': 62 case 'drt':
63 return new DrtRuntimeConfiguration(); 63 return new DrtRuntimeConfiguration();
64 64
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 String executable = suite.configuration['noopt'] 218 String executable = suite.configuration['noopt']
219 ? suite.dartVmNooptBinaryFileName 219 ? suite.dartVmNooptBinaryFileName
220 : suite.dartVmBinaryFileName; 220 : suite.dartVmBinaryFileName;
221 return <Command>[ 221 return <Command>[
222 commandBuilder.getVmCommand(executable, arguments, environmentOverrides) 222 commandBuilder.getVmCommand(executable, arguments, environmentOverrides)
223 ]; 223 ];
224 } 224 }
225 } 225 }
226 226
227 class DartProductRuntimeConfiguration extends DartVmRuntimeConfiguration { 227 class DartAppRuntimeConfiguration extends DartVmRuntimeConfiguration {
228 final bool useBlobs;
229 DartAppRuntimeConfiguration({bool useBlobs}) : useBlobs = useBlobs;
230
228 List<Command> computeRuntimeCommands( 231 List<Command> computeRuntimeCommands(
229 TestSuite suite, 232 TestSuite suite,
230 CommandBuilder commandBuilder, 233 CommandBuilder commandBuilder,
231 CommandArtifact artifact, 234 CommandArtifact artifact,
232 List<String> arguments, 235 List<String> arguments,
233 Map<String, String> environmentOverrides) { 236 Map<String, String> environmentOverrides) {
234 String script = artifact.filename; 237 String script = artifact.filename;
235 String type = artifact.mimeType; 238 String type = artifact.mimeType;
236 if (script != null && type != 'application/dart-snapshot') { 239 if (script != null && type != 'application/dart-snapshot') {
237 throw "dart_product cannot run files of type '$type'."; 240 throw "dart_app cannot run files of type '$type'.";
238 } 241 }
239 242
240 var augmentedArgs = new List(); 243 var augmentedArgs = new List();
241 augmentedArgs.add("--run-app-snapshot=${artifact.filename}"); 244 augmentedArgs.add("--run-app-snapshot=${artifact.filename}");
245 if (useBlobs) {
246 augmentedArgs.add("--use-blobs");
247 }
242 augmentedArgs.addAll(arguments); 248 augmentedArgs.addAll(arguments);
243 249
244 return <Command>[ 250 return <Command>[
245 commandBuilder.getVmCommand(suite.dartVmBinaryFileName, 251 commandBuilder.getVmCommand(suite.dartVmBinaryFileName,
246 augmentedArgs, environmentOverrides) 252 augmentedArgs, environmentOverrides)
247 ]; 253 ];
248 } 254 }
249 } 255 }
250 256
251 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration { 257 class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration { 317 class DummyRuntimeConfiguration extends DartVmRuntimeConfiguration {
312 List<Command> computeRuntimeCommands( 318 List<Command> computeRuntimeCommands(
313 TestSuite suite, 319 TestSuite suite,
314 CommandBuilder commandBuilder, 320 CommandBuilder commandBuilder,
315 CommandArtifact artifact, 321 CommandArtifact artifact,
316 List<String> arguments, 322 List<String> arguments,
317 Map<String, String> environmentOverrides) { 323 Map<String, String> environmentOverrides) {
318 throw "Unimplemented runtime '$runtimeType'"; 324 throw "Unimplemented runtime '$runtimeType'";
319 } 325 }
320 } 326 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698