| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 event/callback protocol of the stream implementations. | 5 // Test the event/callback protocol of the stream implementations. |
| 6 // Uses a non-zero timer so it fails on d8. | 6 // Uses a non-zero timer so it fails on d8. |
| 7 | 7 |
| 8 library stream_state_nonzero_timer_test; | 8 library stream_state_nonzero_timer_test; |
| 9 | 9 |
| 10 import "dart:async"; | 10 import "dart:async"; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // After that, the controller stays paused until the pending queue | 73 // After that, the controller stays paused until the pending queue |
| 74 // is empty. | 74 // is empty. |
| 75 }) | 75 }) |
| 76 ..expectPause(true) | 76 ..expectPause(true) |
| 77 ..expectData(43) | 77 ..expectData(43) |
| 78 ..expectPause(false, () { t.close(); }) | 78 ..expectPause(false, () { t.close(); }) |
| 79 ..expectDone() | 79 ..expectDone() |
| 80 ..expectSubscription(false, false); | 80 ..expectSubscription(false, false); |
| 81 t..subscribe()..add(42); | 81 t..subscribe()..add(42); |
| 82 }); | 82 }); |
| 83 |
| 84 test("$p-pause-during-callback", () { |
| 85 var t = new StreamProtocolTest(broadcast); |
| 86 t..expectSubscription(true, false) |
| 87 ..expectData(42, () { |
| 88 t.pause(); |
| 89 }) |
| 90 ..expectPause(true, () { |
| 91 t.resume(); |
| 92 }) |
| 93 ..expectPause(false, () { |
| 94 t.pause(); |
| 95 t.resume(); |
| 96 t.close(); |
| 97 }) |
| 98 ..expectDone() |
| 99 ..expectSubscription(false, false); |
| 100 t..subscribe() |
| 101 ..add(42); |
| 102 }); |
| 83 } | 103 } |
| OLD | NEW |