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

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

Issue 2946333002: Added timeout parameter to RawSocket and Socket connect, which allows for the specification of a ma… (Closed)
Patch Set: Updated CHANGELOG.md Created 3 years, 6 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 | « sdk/lib/io/socket.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) 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "dart:async"; 10 import "dart:async";
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 socket.close(); 190 socket.close();
191 server.close(); 191 server.close();
192 asyncEnd(); 192 asyncEnd();
193 }, onDone: () { 193 }, onDone: () {
194 Expect.fail("Unexpected pipe completion"); 194 Expect.fail("Unexpected pipe completion");
195 }); 195 });
196 }); 196 });
197 }); 197 });
198 } 198 }
199 199
200 void testConnectTimeout() {
201 asyncStart();
202 Duration timeout = new Duration(milliseconds: 20);
203 Socket.connect("8.8.8.7", 80, timeout: timeout).then((socket) {
204 Expect.fail("Unexpected connection made.");
205 asyncEnd();
206 }).catchError((e) {
207 Expect.isTrue(e is SocketException);
208 asyncEnd();
209 });
210 }
211
200 main() { 212 main() {
201 testArguments(); 213 testArguments();
202 testSimpleBind(); 214 testSimpleBind();
203 testInvalidBind(); 215 testInvalidBind();
204 testConnectImmediateDestroy(); 216 testConnectImmediateDestroy();
205 testConnectConsumerClose(); 217 testConnectConsumerClose();
206 testConnectConsumerWriteClose(); 218 testConnectConsumerWriteClose();
207 testConnectStreamClose(); 219 testConnectStreamClose();
208 testConnectStreamDataClose(true); 220 testConnectStreamDataClose(true);
209 testConnectStreamDataClose(false); 221 testConnectStreamDataClose(false);
210 testConnectStreamDataCloseCancel(true); 222 testConnectStreamDataCloseCancel(true);
211 testConnectStreamDataCloseCancel(false); 223 testConnectStreamDataCloseCancel(false);
224 testConnectTimeout();
212 } 225 }
OLDNEW
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698