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(); |
} |