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

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

Issue 12213092: Rework Timer interface. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import 'dart:io'; 6 import 'dart:io';
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 8
9 void testEmptyListOutputStream1() { 9 void testEmptyListOutputStream1() {
10 ListOutputStream stream = new ListOutputStream(); 10 ListOutputStream stream = new ListOutputStream();
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 void onClosed() { 120 void onClosed() {
121 Expect.equals(4, result.length); 121 Expect.equals(4, result.length);
122 for (var i = 0; i < result.length; i++) Expect.equals(i + 1, result[i]); 122 for (var i = 0; i < result.length; i++) Expect.equals(i + 1, result[i]);
123 donePort.toSendPort().send(null); 123 donePort.toSendPort().send(null);
124 } 124 }
125 125
126 stream.onData = onData; 126 stream.onData = onData;
127 stream.onClosed = onClosed; 127 stream.onClosed = onClosed;
128 128
129 new Timer(0, (_) { 129 Timer.run(() {
130 result.add(1); 130 result.add(1);
131 stream.write([2]); 131 stream.write([2]);
132 132
133 new Timer(0, (_) { 133 Timer.run(() {
134 result.add(3); 134 result.add(3);
135 stream.write([4]); 135 stream.write([4]);
136 stream.close(); 136 stream.close();
137 }); 137 });
138 }); 138 });
139 139
140 donePort.receive((x,y) => donePort.close()); 140 donePort.receive((x,y) => donePort.close());
141 } 141 }
142 142
143 void testListOutputStream5() { 143 void testListOutputStream5() {
(...skipping 20 matching lines...) Expand all
164 164
165 main() { 165 main() {
166 testEmptyListOutputStream1(); 166 testEmptyListOutputStream1();
167 testEmptyListOutputStream2(); 167 testEmptyListOutputStream2();
168 testListOutputStream1(); 168 testListOutputStream1();
169 testListOutputStream2(); 169 testListOutputStream2();
170 testListOutputStream3(); 170 testListOutputStream3();
171 testListOutputStream4(); 171 testListOutputStream4();
172 testListOutputStream5(); 172 testListOutputStream5();
173 } 173 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_shutdown_test.dart ('k') | tests/standalone/io/secure_session_resume_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698