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

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

Issue 1660093002: Stop working around dart-lang/sdk#23497. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Increase the SDK constraint. Created 4 years, 11 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 | « no previous file | lib/src/backend/invoker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/declarer.dart
diff --git a/lib/src/backend/declarer.dart b/lib/src/backend/declarer.dart
index 5c59eac849fbf5423abda0cf0b6d4f1f6e25e2b5..72e4d317a12319cfdcc70a88990ff3d53cdc56d9 100644
--- a/lib/src/backend/declarer.dart
+++ b/lib/src/backend/declarer.dart
@@ -78,16 +78,16 @@ class Declarer {
testOn: testOn, timeout: timeout, skip: skip, onPlatform: onPlatform,
tags: tags));
- _entries.add(new LocalTest(_prefix(name), metadata, () {
+ _entries.add(new LocalTest(_prefix(name), metadata, () async {
// TODO(nweiz): It might be useful to throw an error here if a test starts
// running while other tests from the same declarer are also running,
// since they might share closurized state.
- // TODO(nweiz): Use async/await here once issue 23497 has been fixed in
- // two stable versions.
- return Invoker.current.waitForOutstandingCallbacks(() {
- return _runSetUps().then((_) => body());
- }).then((_) => _runTearDowns());
+ await Invoker.current.waitForOutstandingCallbacks(() async {
+ await _runSetUps();
+ await body();
+ });
+ await _runTearDowns();
}));
}
@@ -161,16 +161,9 @@ class Declarer {
///
/// If no set-up functions are declared, this returns a [Future] that
/// completes immediately.
- Future _runSetUps() {
- // TODO(nweiz): Use async/await here once issue 23497 has been fixed in two
- // stable versions.
- if (_parent != null) {
- return _parent._runSetUps().then((_) {
- return Future.forEach(_setUps, (setUp) => setUp());
- });
- }
-
- return Future.forEach(_setUps, (setUp) => setUp());
+ Future _runSetUps() async {
+ if (_parent != null) await _parent._runSetUps();
+ await Future.forEach(_setUps, (setUp) => setUp());
}
/// Run the tear-up functions for this and any parent groups.
« no previous file with comments | « no previous file | lib/src/backend/invoker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698