Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: test/multi_channel_test.dart

Issue 1644943004: Fix the MultiChannel constructor. (Closed) Base URL: git@github.com:dart-lang/stream_channel.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:stream_channel/stream_channel.dart'; 7 import 'package:stream_channel/stream_channel.dart';
8 import 'package:test/test.dart'; 8 import 'package:test/test.dart';
9 9
10 import 'utils.dart'; 10 import 'utils.dart';
11 11
12 void main() { 12 void main() {
13 var oneToTwo; 13 var oneToTwo;
14 var twoToOne; 14 var twoToOne;
15 var channel1; 15 var channel1;
16 var channel2; 16 var channel2;
17 setUp(() { 17 setUp(() {
18 oneToTwo = new StreamController(); 18 oneToTwo = new StreamController();
19 twoToOne = new StreamController(); 19 twoToOne = new StreamController();
20 channel1 = new MultiChannel(twoToOne.stream, oneToTwo.sink); 20 channel1 = new MultiChannel(
21 channel2 = new MultiChannel(oneToTwo.stream, twoToOne.sink); 21 new StreamChannel(twoToOne.stream, oneToTwo.sink));
22 channel2 = new MultiChannel(
23 new StreamChannel(oneToTwo.stream, twoToOne.sink));
22 }); 24 });
23 25
24 group("the default virtual channel", () { 26 group("the default virtual channel", () {
25 test("begins connected", () { 27 test("begins connected", () {
26 var first = true; 28 var first = true;
27 channel2.stream.listen(expectAsync((message) { 29 channel2.stream.listen(expectAsync((message) {
28 if (first) { 30 if (first) {
29 expect(message, equals("hello")); 31 expect(message, equals("hello"));
30 first = false; 32 first = false;
31 } else { 33 } else {
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 test("emits an error, the error is sent only to the default channel", () { 303 test("emits an error, the error is sent only to the default channel", () {
302 channel1.stream.listen(expectAsync((_) {}, count: 0), 304 channel1.stream.listen(expectAsync((_) {}, count: 0),
303 onError: expectAsync((error) => expect(error, equals("oh no")))); 305 onError: expectAsync((error) => expect(error, equals("oh no"))));
304 virtual1.stream.listen(expectAsync((_) {}, count: 0), 306 virtual1.stream.listen(expectAsync((_) {}, count: 0),
305 onError: expectAsync((_) {}, count: 0)); 307 onError: expectAsync((_) {}, count: 0));
306 308
307 twoToOne.addError("oh no"); 309 twoToOne.addError("oh no");
308 }); 310 });
309 }); 311 });
310 } 312 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698