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

Unified Diff: lib/src/runner/test_platform.dart

Issue 983573002: Add support for running browser tests to the test runner. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Created 5 years, 10 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
Index: lib/src/runner/test_platform.dart
diff --git a/lib/src/runner/test_platform.dart b/lib/src/runner/test_platform.dart
new file mode 100644
index 0000000000000000000000000000000000000000..406dad0cefc4ebef5222cde9bb661282007de23d
--- /dev/null
+++ b/lib/src/runner/test_platform.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2015, 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.
+
+// TODO(nweiz): support pluggable platforms.
+/// An enum of all platforms on which tests can run.
+class TestPlatform {
+ /// The command-line Dart VM.
+ static const vm = const TestPlatform._("VM", "vm");
+
+ /// Google Chrome.
+ static const chrome = const TestPlatform._("Chrome", "chrome");
+
+ /// A list of all instances of [TestPlatform].
+ static const all = const [vm, chrome];
+
+ /// Finds a platform by its identifier string.
+ ///
+ /// If no platform is found, returns `null`.
+ static TestPlatform find(String identifier) =>
+ all.firstWhere((platform) => platform.identifier == identifier,
+ orElse: () => null);
+
+ /// The human-friendly name of the platform.
+ final String name;
+
+ /// The identifier used to look up the platform.
+ final String identifier;
+
+ const TestPlatform._(this.name, this.identifier);
+
+ String toString() => name;
+}

Powered by Google App Engine
This is Rietveld 408576698