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

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

Issue 2202533003: Return futures on Stream.cancel when possible. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Don't make Pipe.cancel wait for the null future. Created 4 years, 3 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: tests/lib/async/stream_periodic_test.dart
diff --git a/tests/lib/async/stream_periodic_test.dart b/tests/lib/async/stream_periodic_test.dart
index b333966065bd78c19ff70e73ec83c92227443e96..f755d76ef41f9c958ad9afe0839824dd338d27a2 100644
--- a/tests/lib/async/stream_periodic_test.dart
+++ b/tests/lib/async/stream_periodic_test.dart
@@ -16,7 +16,10 @@ main() {
subscription = stream.listen(expectAsync((data) {
expect(data, isNull);
receivedCount++;
- if (receivedCount == 5) subscription.cancel();
+ if (receivedCount == 5) {
+ var future = subscription.cancel();
+ expect(future, completes);
+ }
}, count: 5));
});
}
« no previous file with comments | « tests/lib/async/stream_controller_test.dart ('k') | tests/lib/async/stream_subscription_as_future_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698