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

Side by Side Diff: test/stream_zip_test.dart

Issue 2161283002: Fix Dart 1.17 strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Created 4 years, 5 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 | « test/stream_splitter_test.dart ('k') | test/subscription_stream_test.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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:async/async.dart"; 7 import "package:async/async.dart";
8 import "package:test/test.dart"; 8 import "package:test/test.dart";
9 9
10 /// Create an error with the same values as [base], except that it throwsA 10 /// Create an error with the same values as [base], except that it throwsA
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 }); 30 });
31 return controller.stream; 31 return controller.stream;
32 } 32 }
33 33
34 /// Counter used to give varying delays for streams. 34 /// Counter used to give varying delays for streams.
35 int ctr = 0; 35 int ctr = 0;
36 36
37 main() { 37 main() {
38 // Test that zipping [streams] gives the results iterated by [expectedData]. 38 // Test that zipping [streams] gives the results iterated by [expectedData].
39 testZip(Iterable streams, Iterable expectedData) { 39 testZip(Iterable<Stream> streams, Iterable expectedData) {
40 List data = []; 40 List data = [];
41 Stream zip = new StreamZip(streams); 41 Stream zip = new StreamZip(streams);
42 zip.listen(data.add, onDone: expectAsync(() { 42 zip.listen(data.add, onDone: expectAsync(() {
43 expect(data, equals(expectedData)); 43 expect(data, equals(expectedData));
44 })); 44 }));
45 } 45 }
46 46
47 test("Basic", () { 47 test("Basic", () {
48 testZip([mks([1, 2, 3]), mks([4, 5, 6]), mks([7, 8, 9])], 48 testZip([mks([1, 2, 3]), mks([4, 5, 6]), mks([7, 8, 9])],
49 [[1, 4, 7], [2, 5, 8], [3, 6, 9]]); 49 [[1, 4, 7], [2, 5, 8], [3, 6, 9]]);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } else if (ctr == 2) { 227 } else if (ctr == 2) {
228 sub.pause(); 228 sub.pause();
229 new Future.delayed(const Duration(milliseconds: 25)).then((_) { 229 new Future.delayed(const Duration(milliseconds: 25)).then((_) {
230 sub.resume(); 230 sub.resume();
231 }); 231 });
232 } 232 }
233 ctr++; 233 ctr++;
234 }, count: 4)); 234 }, count: 4));
235 }); 235 });
236 } 236 }
OLDNEW
« no previous file with comments | « test/stream_splitter_test.dart ('k') | test/subscription_stream_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698