| Index: tests/lib/async/stream_controller_async_test.dart
|
| diff --git a/tests/lib/async/stream_controller_async_test.dart b/tests/lib/async/stream_controller_async_test.dart
|
| index 6efa9b69a9bfe6a94740aa54ee4520161a4d767e..3c65a7e87f981d2b2d7718586d34a46535622828 100644
|
| --- a/tests/lib/async/stream_controller_async_test.dart
|
| +++ b/tests/lib/async/stream_controller_async_test.dart
|
| @@ -80,11 +80,11 @@ testSingleController() {
|
| Stream stream = c.stream;
|
| int counter = 0;
|
| var subscription;
|
| - subscription = stream.subscribe(onData: (data) {
|
| + subscription = stream.listen((data) {
|
| counter += data;
|
| - Expect.throws(() => stream.subscribe(), (e) => e is StateError);
|
| - subscription.unsubscribe();
|
| - stream.subscribe(onData: (data) {
|
| + Expect.throws(() => stream.listen(null), (e) => e is StateError);
|
| + subscription.cancel();
|
| + stream.listen((data) {
|
| counter += data * 10;
|
| },
|
| onDone: expectAsync0(() {
|
| @@ -106,8 +106,8 @@ testSingleController() {
|
| sink.add(1);
|
| sink.add(2);
|
| sink.close();
|
| - stream.subscribe(
|
| - onData: (data) {
|
| + stream.listen(
|
| + (data) {
|
| counter += data;
|
| },
|
| onDone: expectAsync0(() {
|
| @@ -122,17 +122,17 @@ testSingleController() {
|
| StreamSink sink = c.sink;
|
| Stream stream = c.stream;
|
| int counter = 0;
|
| - var subscription = stream.subscribe();
|
| + var subscription = stream.listen(null);
|
| subscription.onData(expectAsync1((data) {
|
| counter += data;
|
| - subscription.unsubscribe();
|
| - stream.subscribe(onData: (data) {
|
| + subscription.cancel();
|
| + stream.listen((data) {
|
| counter += 10 * data;
|
| },
|
| onDone: expectAsync0(() {
|
| Expect.equals(1 + 20 + 30 + 40 + 50, counter);
|
| }));
|
| - Expect.throws(() => stream.subscribe(), (e) => e is StateError);
|
| + Expect.throws(() => stream.listen(null), (e) => e is StateError);
|
| }));
|
| sink.add(1); // seen by stream 1
|
| sink.add(2); // seen by stream 10 and 100
|
|
|