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

Side by Side Diff: packages/quiver/test/async/stream_router_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 4 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
OLDNEW
1 // Copyright 2013 Google Inc. All Rights Reserved. 1 // Copyright 2013 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 expect(e, 'baz'); 53 expect(e, 'baz');
54 }); 54 });
55 controller.add('baz'); 55 controller.add('baz');
56 return controller.close(); 56 return controller.close();
57 }); 57 });
58 58
59 test('should close child streams', () { 59 test('should close child streams', () {
60 var controller = new StreamController<int>(sync: true); 60 var controller = new StreamController<int>(sync: true);
61 var router = new StreamRouter<int>(controller.stream); 61 var router = new StreamRouter<int>(controller.stream);
62 // toList() will only complete when the child streams are closed 62 // toList() will only complete when the child streams are closed
63 var future = Future 63 var future = Future.wait([
64 .wait([
65 router.route((e) => e % 2 == 0).toList(), 64 router.route((e) => e % 2 == 0).toList(),
66 router.route((e) => e % 2 == 1).toList(), 65 router.route((e) => e % 2 == 1).toList(),
67 ]) 66 ]).then((l) {
68 .then((l) { 67 expect(l, [
69 expect(l, [[4], [5]]); 68 [4],
69 [5]
70 ]);
70 }); 71 });
71 controller 72 controller..add(4)..add(5);
72 ..add(4)
73 ..add(5);
74 router.close(); 73 router.close();
75 return future; 74 return future;
76 }); 75 });
77 }); 76 });
78 } 77 }
OLDNEW
« no previous file with comments | « packages/quiver/test/async/stream_buffer_test.dart ('k') | packages/quiver/test/check_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698