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

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

Issue 1715523003: Warn when an unsupported platform is passed. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 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
« no previous file with comments | « doc/package_config.md ('k') | lib/src/backend/platform_selector.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/operating_system.dart
diff --git a/lib/src/backend/operating_system.dart b/lib/src/backend/operating_system.dart
index 4ed251d3ae045131e1886ba4e64c883495024808..610f3b581f96636c5f0c00080da1a8315d078397 100644
--- a/lib/src/backend/operating_system.dart
+++ b/lib/src/backend/operating_system.dart
@@ -9,25 +9,25 @@
/// running the test runner.
class OperatingSystem {
/// Microsoft Windows.
- static const windows = const OperatingSystem._("windows");
+ static const windows = const OperatingSystem._("Windows", "windows");
/// Mac OS X.
- static const macOS = const OperatingSystem._("mac-os");
+ static const macOS = const OperatingSystem._("OS X", "mac-os");
kevmoo 2016/02/19 02:08:47 ios was added in 1.14 – fyi
nweiz 2016/02/23 22:02:38 I'll add that in a separate CL.
/// GNU/Linux.
- static const linux = const OperatingSystem._("linux");
+ static const linux = const OperatingSystem._("Linux", "linux");
/// Android.
///
/// Since this is the operating system the test runner is running on, this
/// won't be true when testing remotely on an Android browser.
- static const android = const OperatingSystem._("android");
+ static const android = const OperatingSystem._("Android", "android");
/// No operating system.
///
/// This is used when running in the browser, or if an unrecognized operating
/// system is used. It can't be referenced by name in platform selectors.
- static const none = const OperatingSystem._("none");
+ static const none = const OperatingSystem._("none", "none");
/// A list of all instances of [OperatingSystem] other than [none].
static const all = const [windows, macOS, linux, android];
@@ -52,13 +52,16 @@ class OperatingSystem {
}
}
- /// The name of the operating system.
+ /// The human-friendly of the operating system.
final String name;
+ /// The identifier used to look up the operating system.
+ final String identifier;
+
/// Whether this is a POSIX-ish operating system.
bool get isPosix => this != windows && this != none;
- const OperatingSystem._(this.name);
+ const OperatingSystem._(this.name, this.identifier);
String toString() => name;
}
« no previous file with comments | « doc/package_config.md ('k') | lib/src/backend/platform_selector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698