OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 basic StreamController and StreamController.singleSubscription. | 5 // Test the basic StreamController and StreamController.singleSubscription. |
6 library stream_controller_test; | 6 library stream_controller_test; |
7 | 7 |
8 import "package:expect/expect.dart"; | |
9 import 'dart:async'; | 8 import 'dart:async'; |
10 import 'event_helper.dart'; | 9 import 'event_helper.dart'; |
11 | 10 |
12 testMultiController() { | 11 testMultiController() { |
13 // Test normal flow. | 12 // Test normal flow. |
14 var c = new StreamController.broadcast(); | 13 var c = new StreamController.broadcast(); |
15 Events expectedEvents = new Events() | 14 Events expectedEvents = new Events() |
16 ..add(42) | 15 ..add(42) |
17 ..add("dibs") | 16 ..add("dibs") |
18 ..error("error!") | 17 ..error("error!") |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 Expect.isTrue(c.isClosed); | 404 Expect.isTrue(c.isClosed); |
406 } | 405 } |
407 } | 406 } |
408 | 407 |
409 main() { | 408 main() { |
410 testMultiController(); | 409 testMultiController(); |
411 testSingleController(); | 410 testSingleController(); |
412 testExtraMethods(); | 411 testExtraMethods(); |
413 testClosed(); | 412 testClosed(); |
414 } | 413 } |
OLD | NEW |