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

Unified Diff: pkg/scheduled_test/lib/src/mock_clock.dart

Issue 12452008: Stop working around issue 8512. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « no previous file | utils/pub/error_group.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/mock_clock.dart
diff --git a/pkg/scheduled_test/lib/src/mock_clock.dart b/pkg/scheduled_test/lib/src/mock_clock.dart
index bda216f35d8d092369d7235edf65d9d023dccca5..d60e41830881180de0134a678b7834d932c45a63 100644
--- a/pkg/scheduled_test/lib/src/mock_clock.dart
+++ b/pkg/scheduled_test/lib/src/mock_clock.dart
@@ -86,20 +86,14 @@ class _MockTimer implements Timer {
/// The subscription to the [Clock.onTick] stream.
StreamSubscription _subscription;
- // TODO(nweiz): Remove this when issue 8512 is fixed.
- var _cancelled = false;
-
_MockTimer(Duration duration, this._callback)
: _time = _clock.time + duration.inMilliseconds {
_subscription = _clock.onTick.listen((time) {
- if (_cancelled || time < _time) return;
+ if (time < _time) return;
_subscription.cancel();
_callback();
});
}
- void cancel() {
- _cancelled = true;
- _subscription.cancel();
- }
+ void cancel() => _subscription.cancel();
}
« no previous file with comments | « no previous file | utils/pub/error_group.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698