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

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

Issue 311513002: Enable throttleing of HttpClient per host, with default being 6. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « tests/standalone/io/http_response_deadline_test.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 "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 request.response.done.catchError((e) {}); 155 request.response.done.catchError((e) {});
156 }, 156 },
157 onError: (error) { }); 157 onError: (error) { });
158 }, 158 },
159 onError: (error) { }); 159 onError: (error) { });
160 160
161 // Create a number of client requests and keep then active. Then 161 // Create a number of client requests and keep then active. Then
162 // close the client and wait for the server to lose all active 162 // close the client and wait for the server to lose all active
163 // connections. 163 // connections.
164 var client= new HttpClient(); 164 var client= new HttpClient();
165 client.maxConnectionsPerHost = totalConnections;
165 for (int i = 0; i < totalConnections; i++) { 166 for (int i = 0; i < totalConnections; i++) {
166 client.post("127.0.0.1", server.port, "/") 167 client.post("127.0.0.1", server.port, "/")
167 .then((request) { 168 .then((request) {
168 request.add([0]); 169 request.add([0]);
169 // TODO(sgjesse): Make this test work with 170 // TODO(sgjesse): Make this test work with
170 //request.response instead of request.close() return 171 //request.response instead of request.close() return
171 //return request.response; 172 //return request.response;
172 request.done.catchError((e) {}); 173 request.done.catchError((e) {});
173 return request.close(); 174 return request.close();
174 }) 175 })
(...skipping 23 matching lines...) Expand all
198 test1(10); 199 test1(10);
199 test2(1, 10); 200 test2(1, 10);
200 test2(10, 10); 201 test2(10, 10);
201 test2(10, 1000); 202 test2(10, 1000);
202 test3(1); 203 test3(1);
203 test3(10); 204 test3(10);
204 test4(); 205 test4();
205 test5(1); 206 test5(1);
206 test5(10); 207 test5(10);
207 } 208 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_response_deadline_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698