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

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

Issue 1960503002: Fix all strong-mode errors and warnings. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: .analysis_options Created 4 years, 7 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/runner/configuration/load.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/runner/load_suite.dart
diff --git a/lib/src/runner/load_suite.dart b/lib/src/runner/load_suite.dart
index 08cbda308964aeb477ac0eef4f55dcdd84a5fc67..97a2ba40bd45a5c1d89ac00e371399708c835d7d 100644
--- a/lib/src/runner/load_suite.dart
+++ b/lib/src/runner/load_suite.dart
@@ -65,7 +65,7 @@ class LoadSuite extends Suite implements RunnerSuite {
/// If the the load test is closed before [body] is complete, it will close
/// the suite returned by [body] once it completes.
factory LoadSuite(String name, body(), {String path, TestPlatform platform}) {
- var completer = new Completer.sync();
+ var completer = new Completer<Pair<RunnerSuite, Zone>>.sync();
return new LoadSuite._(name, () {
var invoker = Invoker.current;
invoker.addOutstandingCallback();
@@ -129,6 +129,11 @@ class LoadSuite extends Suite implements RunnerSuite {
LoadSuite._changeSuite(LoadSuite old, this._suiteAndZone)
: super(old.group, path: old.path, platform: old.platform);
+ /// A constructor used by [filter].
+ LoadSuite._filtered(LoadSuite old, Group filtered)
+ : _suiteAndZone = old._suiteAndZone,
+ super(old.group, path: old.path, platform: old.platform);
+
/// Creates a new [LoadSuite] that's identical to this one, but that
/// transforms [suite] once it's loaded.
///
@@ -161,5 +166,11 @@ class LoadSuite extends Suite implements RunnerSuite {
throw 'unreachable';
}
+ LoadSuite filter(bool callback(Test test)) {
+ var filtered = this.group.filter(callback);
+ if (filtered == null) filtered = new Group.root([], metadata: metadata);
+ return new LoadSuite._filtered(this, filtered);
+ }
+
Future close() async {}
}
« no previous file with comments | « lib/src/runner/configuration/load.dart ('k') | lib/src/runner/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698