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 "package:unittest/unittest.dart"; | 8 import "package:test/test.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(sync: true, asBroadcast: false); | 14 mainTest(sync: true, asBroadcast: false); |
15 mainTest(sync: true, asBroadcast: true); | 15 mainTest(sync: true, asBroadcast: true); |
16 mainTest(sync: false, asBroadcast: false); | 16 mainTest(sync: false, asBroadcast: false); |
17 mainTest(sync: false, asBroadcast: true); | 17 mainTest(sync: false, asBroadcast: true); |
18 } | 18 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 t..expectListen() | 156 t..expectListen() |
157 ..expectBroadcastListenOpt() | 157 ..expectBroadcastListenOpt() |
158 ..expectError(42, t.cancel) | 158 ..expectError(42, t.cancel) |
159 ..expectBroadcastCancelOpt() | 159 ..expectBroadcastCancelOpt() |
160 ..expectCancel(t.terminate); | 160 ..expectCancel(t.terminate); |
161 t..listen(cancelOnError: false) | 161 t..listen(cancelOnError: false) |
162 ..error(42) | 162 ..error(42) |
163 ..close(); | 163 ..close(); |
164 }); | 164 }); |
165 } | 165 } |
OLD | NEW |