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

Side by Side Diff: tests/lib/async/stream_controller_test.dart

Issue 11794043: Remove Signal class and use Future/.whenComplete instead. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Comment updated. Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/lib/async/stream_controller_async_test.dart ('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) 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 'dart:async'; 8 import 'dart:async';
9 import 'event_helper.dart'; 9 import 'event_helper.dart';
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 for (int i = 0; i < v; i++) l.add(i + 1); 224 for (int i = 0; i < v; i++) l.add(i + 1);
225 return l; 225 return l;
226 })); 226 }));
227 sentEvents.replay(c); 227 sentEvents.replay(c);
228 Expect.listEquals(expectedEvents.events, actualEvents.events); 228 Expect.listEquals(expectedEvents.events, actualEvents.events);
229 229
230 // pipe is tested asynchronously and therefore not in this file. 230 // pipe is tested asynchronously and therefore not in this file.
231 c = new StreamController.singleSubscription(); 231 c = new StreamController.singleSubscription();
232 var list = <int>[]; 232 var list = <int>[];
233 c.pipeInto(new CollectionSink<int>(list)) 233 c.pipeInto(new CollectionSink<int>(list))
234 .then(() { Expect.listEquals(<int>[1,2,9,3,9], list); }); 234 .whenComplete(() { Expect.listEquals(<int>[1,2,9,3,9], list); });
235 c.add(1); 235 c.add(1);
236 c.add(2); 236 c.add(2);
237 c.add(9); 237 c.add(9);
238 c.add(3); 238 c.add(3);
239 c.add(9); 239 c.add(9);
240 c.close(); 240 c.close();
241 241
242 // Test transform. 242 // Test transform.
243 c = new StreamController.singleSubscription(); 243 c = new StreamController.singleSubscription();
244 sentEvents = new Events()..add("a")..error(42)..add("b")..close(); 244 sentEvents = new Events()..add("a")..error(42)..add("b")..close();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 actualEvents = new Events.capture(c.distinct((a, b) => a < b)); 352 actualEvents = new Events.capture(c.distinct((a, b) => a < b));
353 sentEvents.replay(c); 353 sentEvents.replay(c);
354 Expect.listEquals(expectedEvents.events, actualEvents.events); 354 Expect.listEquals(expectedEvents.events, actualEvents.events);
355 } 355 }
356 356
357 main() { 357 main() {
358 testController(); 358 testController();
359 testSingleController(); 359 testSingleController();
360 testExtraMethods(); 360 testExtraMethods();
361 } 361 }
OLDNEW
« no previous file with comments | « tests/lib/async/stream_controller_async_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698