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

Unified Diff: tests/lib/async/event_helper.dart

Issue 11794043: Remove Signal class and use Future/.whenComplete instead. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment updated. Created 7 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 | « sdk/lib/async/stream_impl.dart ('k') | tests/lib/async/stream_controller_async_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/event_helper.dart
diff --git a/tests/lib/async/event_helper.dart b/tests/lib/async/event_helper.dart
index 409e0c85933f1fbb11ceb5cc01b2c512e3daa5ce..844721b66001aba9a9198c374b03849b11bac666 100644
--- a/tests/lib/async/event_helper.dart
+++ b/tests/lib/async/event_helper.dart
@@ -112,7 +112,7 @@ class Events implements StreamSink {
* Should only be used when there is a subscription. That is, after a
* call to [subscribeTo].
*/
- void pause([Signal resumeSignal]) {
+ void pause([Future resumeSignal]) {
throw new StateError("Not capturing events.");
}
@@ -134,12 +134,12 @@ class Events implements StreamSink {
class CaptureEvents extends Events {
StreamSubscription subscription;
- SignalCompleter onDoneSignal;
+ Completer onDoneSignal;
bool unsubscribeOnError = false;
CaptureEvents(Stream stream,
{ bool unsubscribeOnError: false })
- : onDoneSignal = new SignalCompleter() {
+ : onDoneSignal = new Completer() {
this.unsubscribeOnError = unsubscribeOnError;
subscription = stream.listen(add,
onError: signalError,
@@ -149,15 +149,15 @@ class CaptureEvents extends Events {
void signalError(AsyncError error) {
super.signalError(error);
- if (unsubscribeOnError) onDoneSignal.complete();
+ if (unsubscribeOnError) onDoneSignal.complete(null);
}
void close() {
super.close();
- if (onDoneSignal != null) onDoneSignal.complete();
+ if (onDoneSignal != null) onDoneSignal.complete(null);
}
- void pause([Signal resumeSignal]) {
+ void pause([Future resumeSignal]) {
subscription.pause(resumeSignal);
}
@@ -168,6 +168,6 @@ class CaptureEvents extends Events {
bool get isPaused => subscription.isPaused;
void onDone(void action()) {
- onDoneSignal.signal.then(action);
+ onDoneSignal.future.whenComplete(action);
}
}
« no previous file with comments | « sdk/lib/async/stream_impl.dart ('k') | tests/lib/async/stream_controller_async_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698