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

Unified Diff: lib/src/backend/invoker.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 | « lib/src/backend/declarer.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/backend/invoker.dart
diff --git a/lib/src/backend/invoker.dart b/lib/src/backend/invoker.dart
index 8ff860ea6f397f3069d2ba7f933d0f120081812d..9644d847fc7e44cbaf542357ae796d566012067c 100644
--- a/lib/src/backend/invoker.dart
+++ b/lib/src/backend/invoker.dart
@@ -178,12 +178,11 @@ class Invoker {
var zone;
var counter = new OutstandingCallbackCounter();
runZoned(() {
- // TODO(nweiz): Use async/await here once issue 23497 has been fixed in
- // two stable versions.
- runZoned(() {
+ runZoned(() async {
zone = Zone.current;
_outstandingCallbackZones.add(zone);
- new Future.sync(fn).then((_) => counter.removeOutstandingCallback());
+ await fn();
+ counter.removeOutstandingCallback();
}, onError: _handleError);
}, zoneValues: {
_counterKey: counter
@@ -260,10 +259,8 @@ class Invoker {
var outstandingCallbacksForBody = new OutstandingCallbackCounter();
- // TODO(nweiz): Use async/await here once issue 23497 has been fixed in two
- // stable versions.
Chain.capture(() {
- runZonedWithValues(() {
+ runZonedWithValues(() async {
_invokerZone = Zone.current;
_outstandingCallbackZones.add(Zone.current);
@@ -276,15 +273,15 @@ class Invoker {
new Future(_test._body)
.then((_) => removeOutstandingCallback());
- _outstandingCallbacks.noOutstandingCallbacks.then((_) {
- if (_timeoutTimer != null) _timeoutTimer.cancel();
- _controller.setState(
- new State(Status.complete, liveTest.state.result));
+ await _outstandingCallbacks.noOutstandingCallbacks;
+ if (_timeoutTimer != null) _timeoutTimer.cancel();
- // Use [Timer.run] here to avoid starving the DOM or other
- // non-microtask events.
- Timer.run(_controller.completer.complete);
- });
+ _controller.setState(
+ new State(Status.complete, liveTest.state.result));
+
+ // Use [Timer.run] here to avoid starving the DOM or other
+ // non-microtask events.
+ Timer.run(_controller.completer.complete);
}, zoneValues: {
#test.invoker: this,
// Use the invoker as a key so that multiple invokers can have different
« no previous file with comments | « lib/src/backend/declarer.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698