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"; |
11 import "package:test/test.dart"; | 11 import "package:unittest/unittest.dart"; |
12 import "stream_state_helper.dart"; | 12 import "stream_state_helper.dart"; |
13 | 13 |
14 const ms5 = const Duration(milliseconds: 5); | 14 const ms5 = const Duration(milliseconds: 5); |
15 | 15 |
16 // Testing pause/resume, some with non-zero duration. This only makes sense for | 16 // Testing pause/resume, some with non-zero duration. This only makes sense for |
17 // non-broadcast streams, since broadcast stream subscriptions handle their | 17 // non-broadcast streams, since broadcast stream subscriptions handle their |
18 // own pauses. | 18 // own pauses. |
19 | 19 |
20 main() { | 20 main() { |
21 var p = "StreamController"; | 21 var p = "StreamController"; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 t.pause(); | 93 t.pause(); |
94 t.resume(); | 94 t.resume(); |
95 t.close(); | 95 t.close(); |
96 }) | 96 }) |
97 ..expectCancel() | 97 ..expectCancel() |
98 ..expectDone(t.terminate); | 98 ..expectDone(t.terminate); |
99 t..listen() | 99 t..listen() |
100 ..add(42); | 100 ..add(42); |
101 }); | 101 }); |
102 } | 102 } |
OLD | NEW |