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

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

Issue 50073007: fix barback and polymer build warnings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
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 d260b78f4df5516a9da8224485eecfd0608ab893..718f47b0ba20bd7697f8e99f1100a080fd923f99 100644
--- a/pkg/scheduled_test/lib/src/mock_clock.dart
+++ b/pkg/scheduled_test/lib/src/mock_clock.dart
@@ -32,7 +32,7 @@ Clock mock() {
typedef void TimerCallback();
-/// Returns a new (possibly mocked) [Timer]. Works the same as [new Timer].
+/// Returns a new (possibly mocked) [Timer]. Works the same as `new Timer`.
nweiz 2013/10/30 19:28:39 Also reference the issue number here.
Timer newTimer(Duration duration, TimerCallback callback) =>
_mocked ? new _MockTimer(duration, callback) : new Timer(duration, callback);
@@ -72,7 +72,7 @@ class Clock {
/// code runs before the next tick.
void run() {
pumpEventQueue().then((_) {
- if (!_broadcastController.hasListener) return;
+ if (!_broadcastController.hasListener) return null;
tick();
return run();
});
@@ -100,5 +100,10 @@ class _MockTimer implements Timer {
});
}
- void cancel() => _subscription.cancel();
+ bool get isActive => _subscription != null;
+
+ void cancel() {
+ _subscription.cancel();
+ _subscription = null;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698