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_async_test; | 6 library stream_controller_async_test; |
7 | 7 |
8 import "package:expect/expect.dart"; | |
9 import 'dart:async'; | 8 import 'dart:async'; |
10 import 'dart:isolate'; | 9 import 'dart:isolate'; |
11 import '../../../pkg/unittest/lib/unittest.dart'; | 10 import '../../../pkg/unittest/lib/unittest.dart'; |
12 import 'event_helper.dart'; | 11 import 'event_helper.dart'; |
13 | 12 |
14 testController() { | 13 testController() { |
15 // Test reduce | 14 // Test reduce |
16 test("StreamController.reduce", () { | 15 test("StreamController.reduce", () { |
17 StreamController c = new StreamController.broadcast(); | 16 StreamController c = new StreamController.broadcast(); |
18 Stream stream = c.stream; | 17 Stream stream = c.stream; |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 testFuture("reduce", (s, act) => s.reduce(0, (a,b) => act(b))); | 451 testFuture("reduce", (s, act) => s.reduce(0, (a,b) => act(b))); |
453 } | 452 } |
454 | 453 |
455 main() { | 454 main() { |
456 testController(); | 455 testController(); |
457 testSingleController(); | 456 testSingleController(); |
458 testExtraMethods(); | 457 testExtraMethods(); |
459 testPause(); | 458 testPause(); |
460 testRethrow(); | 459 testRethrow(); |
461 } | 460 } |
OLD | NEW |