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

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

Issue 141713002: Outline of how to factor out compiler and runtime specifics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Martin's comments Created 6 years, 11 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 | « dart/tools/testing/dart/compiler_configuration.dart ('k') | dart/tools/testing/dart/test_options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/dart/runtime_configuration.dart
diff --git a/dart/tools/testing/dart/runtime_configuration.dart b/dart/tools/testing/dart/runtime_configuration.dart
new file mode 100644
index 0000000000000000000000000000000000000000..383ad3f8786c335f7d3d95190e5a7851849b8145
--- /dev/null
+++ b/dart/tools/testing/dart/runtime_configuration.dart
@@ -0,0 +1,72 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library compiler_configuration;
+
+// TODO(ahe): I expect this class will become abstract very soon.
+class RuntimeConfiguration {
+ // TODO(ahe): Remove this constructor and move the switch to
+ // test_options.dart. We probably want to store an instance of
+ // [RuntimeConfiguration] in [configuration] there.
+ factory RuntimeConfiguration(Map configuration) {
+ String runtime = configuration['runtime'];
+ switch (runtime) {
+ case 'ContentShellOnAndroid':
+ case 'DartiumOnAndroid':
+ case 'chrome':
+ case 'chromeOnAndroid':
+ case 'd8':
+ case 'dartium':
+ case 'ff':
+ case 'firefox':
+ case 'ie10':
+ case 'ie9':
+ case 'jsshell':
+ case 'none':
+ case 'opera':
+ case 'safari':
+ case 'vm':
+ return new RuntimeConfiguration._subclass();
+ case 'drt':
+ return new DrtRuntimeConfiguration();
+ default:
+ throw "Unknown runtime '$runtime'";
+ }
+ }
+
+ RuntimeConfiguration._subclass();
+
+ int computeTimeoutMultiplier({
+ bool isDebug: false,
+ bool isChecked: false,
+ String arch}) {
+ int multiplier = 1;
+ switch (arch) {
+ case 'simarm':
+ case 'arm':
+ case 'simmips':
+ case 'mips':
+ multiplier *= 4;
+ break;
+ }
+ if (isDebug) {
+ multiplier *= 2;
+ }
+ return multiplier;
+ }
+}
+
+class DrtRuntimeConfiguration extends RuntimeConfiguration {
+ DrtRuntimeConfiguration()
+ : super._subclass();
+
+ int computeTimeoutMultiplier({
+ bool isDebug: false,
+ bool isChecked: false,
+ String arch}) {
+ return 4 // Allow additional time for browser testing to run.
+ * super.computeTimeoutMultiplier(
+ isDebug: isDebug, isChecked: isChecked);
+ }
+}
« no previous file with comments | « dart/tools/testing/dart/compiler_configuration.dart ('k') | dart/tools/testing/dart/test_options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698