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

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

Issue 18915008: Let StreamSubscription.cancel return a Future. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove dir stuff. 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: tests/lib/async/stream_state_test.dart
diff --git a/tests/lib/async/stream_state_test.dart b/tests/lib/async/stream_state_test.dart
index f64d720091e3cd16a26ab268b9feb7d136aaaf07..a7c3ab0152d981a42277f6834ce51160383146eb 100644
--- a/tests/lib/async/stream_state_test.dart
+++ b/tests/lib/async/stream_state_test.dart
@@ -74,12 +74,21 @@ mainTest({bool sync, bool asBroadcast}) {
test("$p-sub-data-unsubonerror", () {
var t = asBroadcast ? new StreamProtocolTest.asBroadcast(sync: sync)
: new StreamProtocolTest(sync: sync);
- t..expectListen()
- ..expectBroadcastListenOpt()
- ..expectData(42)
- ..expectError("bad")
- ..expectBroadcastCancelOpt()
- ..expectCancel(t.terminate);
+ if (asBroadcast) {
+ t..expectListen()
+ ..expectBroadcastListenOpt()
floitsch 2013/10/12 18:53:57 You should not need to use "Opt". This is in the "
Anders Johnsen 2013/10/16 11:52:21 Done.
+ ..expectData(42)
+ ..expectError("bad")
+ ..expectBroadcastCancelOpt()
floitsch 2013/10/12 18:53:57 ditto.
Anders Johnsen 2013/10/16 11:52:21 Done.
+ ..expectCancel(t.terminate);
+ } else {
+ t..expectListen()
+ ..expectBroadcastListenOpt()
floitsch 2013/10/12 18:53:57 Remove, since we are in the non-broadcast branch.
Anders Johnsen 2013/10/16 11:52:21 Done.
+ ..expectData(42)
+ ..expectCancel()
+ ..expectBroadcastCancelOpt()
floitsch 2013/10/12 18:53:57 ditto.
Anders Johnsen 2013/10/16 11:52:21 Done.
+ ..expectError("bad", t.terminate);
+ }
t..listen(cancelOnError: true)
..add(42)
..error("bad")

Powered by Google App Engine
This is Rietveld 408576698