| Index: tests/lib/async/stream_controller_async_test.dart
|
| diff --git a/tests/lib/async/stream_controller_async_test.dart b/tests/lib/async/stream_controller_async_test.dart
|
| index 2bfb4f016e07f049e03244eee18b9ac0331f18fc..a130b4cc40512611fb9d232c1962f28037f30e0f 100644
|
| --- a/tests/lib/async/stream_controller_async_test.dart
|
| +++ b/tests/lib/async/stream_controller_async_test.dart
|
| @@ -639,11 +639,12 @@ void testSink({bool sync, bool broadcast, bool asBroadcast}) {
|
| var stream = asBroadcast ? c.stream.asBroadcastStream() : c.stream;
|
| var actual = new Events();
|
| var sub;
|
| + var pauseIsDone = false;
|
| sub = stream.listen(
|
| (v) {
|
| if (v == 3) {
|
| sub.pause(new Future.delayed(const Duration(milliseconds: 15),
|
| - () => null));
|
| + () { pauseIsDone = true; }));
|
| }
|
| actual.add(v);
|
| },
|
| @@ -663,7 +664,15 @@ void testSink({bool sync, bool broadcast, bool asBroadcast}) {
|
| // the done event to the asBroadcastStream controller, which is
|
| // before the final listener gets the event.
|
| // Wait for the pause to end before testing the events.
|
| - return new Future.delayed(const Duration(milliseconds: 50), () {
|
| + dynamic executeWhenPauseIsDone(Function f) {
|
| + if (!pauseIsDone) {
|
| + return new Future.delayed(const Duration(milliseconds: 50), () {
|
| + return executeWhenPauseIsDone(f);
|
| + });
|
| + }
|
| + return f();
|
| + }
|
| + return executeWhenPauseIsDone(() {
|
| Expect.listEquals(expected.events, actual.events);
|
| done();
|
| });
|
|
|