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

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

Issue 1036943002: Add a testOn parameter to test() and group(). (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: 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/invoker.dart ('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/metadata.dart
diff --git a/lib/src/backend/metadata.dart b/lib/src/backend/metadata.dart
index d567a27c9d5c3d0778cdacc7451ffa1498fcb576..0f381f69a062049adeba71323ae0700d4ebf9326 100644
--- a/lib/src/backend/metadata.dart
+++ b/lib/src/backend/metadata.dart
@@ -26,4 +26,20 @@ class Metadata {
Metadata.parse({String testOn})
: this(
testOn: testOn == null ? null : new PlatformSelector.parse(testOn));
+
+ /// Dezerializes the result of [Metadata.serialize] into a new [Metadata].
+ Metadata.deserialize(serialized)
+ : this.parse(testOn: serialized['testOn']);
+
+ /// Return a new [Metadata] that merges [this] with [other].
+ ///
+ /// If the two [Metadata]s have conflicting properties, [other] wins.
+ Metadata merge(Metadata other) =>
+ new Metadata(testOn: testOn.intersect(other.testOn));
+
+ /// Serializes [this] into a JSON-safe object that can be deserialized using
+ /// [new Metadata.deserialize].
+ serialize() => {
+ 'testOn': testOn == PlatformSelector.all ? null : testOn.toString()
+ };
}
« no previous file with comments | « lib/src/backend/invoker.dart ('k') | lib/src/backend/platform_selector.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698