OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |