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

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

Issue 357283003: Fix listeners being added to subscription after onListen was called. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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_transformers.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/async/stream_controller_test.dart
diff --git a/tests/lib/async/stream_controller_test.dart b/tests/lib/async/stream_controller_test.dart
index 3407614088eca3d13e98b6e4a89b37dde2b67e73..685222d43b743e6343dd8798033bdbaf9efaf8d0 100644
--- a/tests/lib/async/stream_controller_test.dart
+++ b/tests/lib/async/stream_controller_test.dart
@@ -657,6 +657,22 @@ void testAsBroadcastListenAfterClosePaused() {
});
}
+void testEventInListen() {
+ asyncStart();
+ // Regression test for http://dartbug.com/19722
+ var c;
+ void send() {
+ c.add(1);
+ }
+ int i = 1;
+ c = new StreamController.broadcast(onListen: send, sync: true);
+ c.stream.listen((v) {
+ Expect.equals(i++, v);
+ }, onDone: asyncEnd);
+ c.add(2);
+ c.close();
+}
+
main() {
asyncStart();
testMultiController();
@@ -674,5 +690,6 @@ main() {
testBroadcastListenAfterClosePaused();
testAsBroadcastListenAfterClose();
testAsBroadcastListenAfterClosePaused();
+ testEventInListen();
asyncEnd();
}
« no previous file with comments | « sdk/lib/async/stream_transformers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698