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

Side by Side Diff: tests/lib/async/stream_controller_async_test.dart

Issue 24457003: Wait for the pause-event to have finished. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test the basic StreamController and StreamController.singleSubscription. 5 // Test the basic StreamController and StreamController.singleSubscription.
6 library stream_controller_async_test; 6 library stream_controller_async_test;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 onDone: actual.close); 652 onDone: actual.close);
653 var sink = c.sink; 653 var sink = c.sink;
654 sink.add(42); 654 sink.add(42);
655 sink.addError("error"); 655 sink.addError("error");
656 sink.addStream(new Stream.fromIterable([1, 2, 3, 4, 5])) 656 sink.addStream(new Stream.fromIterable([1, 2, 3, 4, 5]))
657 .then((_) { 657 .then((_) {
658 sink.add(43); 658 sink.add(43);
659 return sink.close(); 659 return sink.close();
660 }) 660 })
661 .then((_) { 661 .then((_) {
662 if (asBroadcast) { 662 if (asBroadcast || broadcast) {
Lasse Reichstein Nielsen 2013/09/26 11:58:32 Ack, yes. The broadcast stream subscription handle
663 // The done-future of the sink completes when it passes 663 // The done-future of the sink completes when it passes
664 // the done event to the asBroadcastStream controller, which is 664 // the done event to the asBroadcastStream controller, which is
665 // before the final listener gets the event. 665 // before the final listener gets the event.
666 // Wait for the pause to end before testing the events. 666 // Wait for the pause to end before testing the events.
667 dynamic executeWhenPauseIsDone(Function f) { 667 dynamic executeWhenPauseIsDone(Function f) {
668 if (!pauseIsDone) { 668 if (!pauseIsDone) {
669 return new Future.delayed(const Duration(milliseconds: 50), () { 669 return new Future.delayed(const Duration(milliseconds: 50), () {
670 return executeWhenPauseIsDone(f); 670 return executeWhenPauseIsDone(f);
671 }); 671 });
672 } 672 }
(...skipping 19 matching lines...) Expand all
692 testRethrow(); 692 testRethrow();
693 testBroadcastController(); 693 testBroadcastController();
694 testAsBroadcast(); 694 testAsBroadcast();
695 testSink(sync: true, broadcast: false, asBroadcast: false); 695 testSink(sync: true, broadcast: false, asBroadcast: false);
696 testSink(sync: true, broadcast: false, asBroadcast: true); 696 testSink(sync: true, broadcast: false, asBroadcast: true);
697 testSink(sync: true, broadcast: true, asBroadcast: false); 697 testSink(sync: true, broadcast: true, asBroadcast: false);
698 testSink(sync: false, broadcast: false, asBroadcast: false); 698 testSink(sync: false, broadcast: false, asBroadcast: false);
699 testSink(sync: false, broadcast: false, asBroadcast: true); 699 testSink(sync: false, broadcast: false, asBroadcast: true);
700 testSink(sync: false, broadcast: true, asBroadcast: false); 700 testSink(sync: false, broadcast: true, asBroadcast: false);
701 } 701 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698