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

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

Issue 1004013002: Add support for evaluating platform selectors. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Code review changes Created 5 years, 9 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 | « lib/src/backend/platform_selector/visitor.dart ('k') | lib/src/runner/loader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/test_platform.dart
diff --git a/lib/src/runner/test_platform.dart b/lib/src/backend/test_platform.dart
similarity index 52%
rename from lib/src/runner/test_platform.dart
rename to lib/src/backend/test_platform.dart
index 406dad0cefc4ebef5222cde9bb661282007de23d..a52d3075fa91011cd0e8b2891cc76c96c8c5b3e8 100644
--- a/lib/src/runner/test_platform.dart
+++ b/lib/src/backend/test_platform.dart
@@ -2,14 +2,20 @@
// 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 unittest.backend.test_platform;
+
// TODO(nweiz): support pluggable platforms.
/// An enum of all platforms on which tests can run.
class TestPlatform {
+ // When adding new platforms, be sure to update the baseline and derived
+ // variable tests in test/backend/platform_selector/evaluate_test.
+
/// The command-line Dart VM.
- static const vm = const TestPlatform._("VM", "vm");
+ static const vm = const TestPlatform._("VM", "vm", isDartVm: true);
/// Google Chrome.
- static const chrome = const TestPlatform._("Chrome", "chrome");
+ static const chrome = const TestPlatform._("Chrome", "chrome",
+ isBrowser: true, isJS: true, isBlink: true);
/// A list of all instances of [TestPlatform].
static const all = const [vm, chrome];
@@ -27,7 +33,20 @@ class TestPlatform {
/// The identifier used to look up the platform.
final String identifier;
- const TestPlatform._(this.name, this.identifier);
+ /// Whether this platform runs the Dart VM in any capacity.
+ final bool isDartVm;
+
+ /// Whether this platform is a browser.
+ final bool isBrowser;
+
+ /// Whether this platform runs Dart compiled to JavaScript.
+ final bool isJS;
+
+ /// Whether this platform uses the Blink rendering engine.
+ final bool isBlink;
+
+ const TestPlatform._(this.name, this.identifier, {this.isDartVm: false,
+ this.isBrowser: false, this.isJS: false, this.isBlink: false});
String toString() => name;
}
« no previous file with comments | « lib/src/backend/platform_selector/visitor.dart ('k') | lib/src/runner/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698