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

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

Issue 17386002: Fix raw_socket_test off-by-one issue. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 server.close(); 234 server.close();
235 port.close(); 235 port.close();
236 } 236 }
237 }); 237 });
238 238
239 // Pause the server socket subscription and resume it after having 239 // Pause the server socket subscription and resume it after having
240 // connected a number client sockets. Then connect more client 240 // connected a number client sockets. Then connect more client
241 // sockets. 241 // sockets.
242 subscription.pause(); 242 subscription.pause();
243 var connectCount = 0; 243 var connectCount = 0;
244 for (int i = 0; i <= socketCount / 2; i++) { 244 for (int i = 0; i < socketCount / 2; i++) {
245 RawSocket.connect("127.0.0.1", server.port).then((_) { 245 RawSocket.connect("127.0.0.1", server.port).then((_) {
246 if (++connectCount == socketCount / 2) { 246 if (++connectCount == socketCount / 2) {
247 subscription.resume(); 247 subscription.resume();
248 resumed = true; 248 resumed = true;
249 for (int i = connectCount; i < socketCount; i++) { 249 for (int i = connectCount; i < socketCount; i++) {
250 RawSocket.connect("127.0.0.1", server.port).then((_) {}); 250 RawSocket.connect("127.0.0.1", server.port).then((_) {});
251 } 251 }
252 } 252 }
253 }); 253 });
254 } 254 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 testSimpleBind(); 340 testSimpleBind();
341 testCloseOneEnd("client"); 341 testCloseOneEnd("client");
342 testCloseOneEnd("server"); 342 testCloseOneEnd("server");
343 testInvalidBind(); 343 testInvalidBind();
344 testSimpleConnect(); 344 testSimpleConnect();
345 testServerListenAfterConnect(); 345 testServerListenAfterConnect();
346 testSimpleReadWrite(); 346 testSimpleReadWrite();
347 testPauseServerSocket(); 347 testPauseServerSocket();
348 testPauseSocket(); 348 testPauseSocket();
349 } 349 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698