| 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 library stream_state_test; | 6 library stream_state_test; |
| 7 | 7 |
| 8 import "../../../pkg/unittest/lib/unittest.dart"; | 8 import "../../../pkg/unittest/lib/unittest.dart"; |
| 9 import "stream_state_helper.dart"; | 9 import "stream_state_helper.dart"; |
| 10 | 10 |
| 11 const ms5 = const Duration(milliseconds: 5); | 11 const ms5 = const Duration(milliseconds: 5); |
| 12 | 12 |
| 13 main() { | 13 main() { |
| 14 mainTest(false); | 14 mainTest(false); |
| 15 mainTest(true); | 15 // TODO(floitsch): reenable? |
| 16 // mainTest(true); |
| 16 } | 17 } |
| 17 | 18 |
| 18 mainTest(bool broadcast) { | 19 mainTest(bool broadcast) { |
| 19 var p = broadcast ? "BC" : "SC"; | 20 var p = broadcast ? "BC" : "SC"; |
| 20 test("$p-sub-data-done", () { | 21 test("$p-sub-data-done", () { |
| 21 var t = new StreamProtocolTest(broadcast); | 22 var t = new StreamProtocolTest(broadcast); |
| 22 t..expectSubscription(true, false) | 23 t..expectSubscription(true, false) |
| 23 ..expectData(42) | 24 ..expectData(42) |
| 24 ..expectDone() | 25 ..expectDone() |
| 25 ..expectSubscription(false, false); | 26 ..expectSubscription(false, false); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 var t = new StreamProtocolTest(broadcast); | 135 var t = new StreamProtocolTest(broadcast); |
| 135 t..expectSubscription(true, false) | 136 t..expectSubscription(true, false) |
| 136 ..expectDone() | 137 ..expectDone() |
| 137 ..expectSubscription(false, false) | 138 ..expectSubscription(false, false) |
| 138 ..expectDone(); | 139 ..expectDone(); |
| 139 t..subscribe() | 140 t..subscribe() |
| 140 ..close() | 141 ..close() |
| 141 ..subscribe(); // Subscribe after done does not cause callbacks at all. | 142 ..subscribe(); // Subscribe after done does not cause callbacks at all. |
| 142 }); | 143 }); |
| 143 } | 144 } |
| OLD | NEW |