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 "../../../pkg/unittest/lib/unittest.dart"; | 11 import "../../../pkg/unittest/lib/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 main() { | 16 main() { |
17 mainTest(false); | 17 mainTest(false); |
18 mainTest(true); | 18 // TODO(floitsch): reenable? |
| 19 // mainTest(true); |
19 } | 20 } |
20 | 21 |
21 mainTest(bool broadcast) { | 22 mainTest(bool broadcast) { |
22 var p = broadcast ? "BC" : "SC"; | 23 var p = broadcast ? "BC" : "SC"; |
23 | 24 |
24 test("$p-sub-data/pause/resume/pause/resume-done", () { | 25 test("$p-sub-data/pause/resume/pause/resume-done", () { |
25 var t = new StreamProtocolTest(broadcast); | 26 var t = new StreamProtocolTest(broadcast); |
26 t..expectSubscription(true, false) | 27 t..expectSubscription(true, false) |
27 ..expectData(42, () { | 28 ..expectData(42, () { |
28 t.pause(); | 29 t.pause(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 t.pause(); | 95 t.pause(); |
95 t.resume(); | 96 t.resume(); |
96 t.close(); | 97 t.close(); |
97 }) | 98 }) |
98 ..expectDone() | 99 ..expectDone() |
99 ..expectSubscription(false, false); | 100 ..expectSubscription(false, false); |
100 t..subscribe() | 101 t..subscribe() |
101 ..add(42); | 102 ..add(42); |
102 }); | 103 }); |
103 } | 104 } |
OLD | NEW |