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

Side by Side Diff: tests/standalone/io/io_sink_test.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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/standalone/io/http_proxy_test.dart ('k') | tests/standalone/standalone.status » ('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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:async"; 6 import "dart:async";
7 import "dart:io"; 7 import "dart:io";
8 import "dart:isolate"; 8 import "dart:isolate";
9 9
10 class TestConsumer implements StreamConsumer { 10 class TestConsumer implements StreamConsumer {
(...skipping 16 matching lines...) Expand all
27 return stream.fold( 27 return stream.fold(
28 received, 28 received,
29 (list, value) { 29 (list, value) {
30 list.addAll(value); 30 list.addAll(value);
31 return list; 31 return list;
32 }) 32 })
33 .then((_) {}); 33 .then((_) {});
34 } 34 }
35 35
36 Future close() { 36 Future close() {
37 return new Future.immediate(null) 37 return new Future.value()
38 .then((_) { 38 .then((_) {
39 if (closePort != null) closePort.close(); 39 if (closePort != null) closePort.close();
40 Expect.listEquals(expected, received); 40 Expect.listEquals(expected, received);
41 if (expcetedAddStreamCount >= 0) { 41 if (expcetedAddStreamCount >= 0) {
42 Expect.equals(expcetedAddStreamCount, addStreamCount); 42 Expect.equals(expcetedAddStreamCount, addStreamCount);
43 } 43 }
44 }); 44 });
45 } 45 }
46 } 46 }
47 47
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 controller.close(); 100 controller.close();
101 } 101 }
102 } 102 }
103 103
104 void main() { 104 void main() {
105 testClose(); 105 testClose();
106 testAddClose(); 106 testAddClose();
107 testAddStreamClose(); 107 testAddStreamClose();
108 testAddStreamAddClose(); 108 testAddStreamAddClose();
109 } 109 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_proxy_test.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698