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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 for (int i = 0; i < totalConnections; i++) { | 165 for (int i = 0; i < totalConnections; i++) { |
166 client.post("127.0.0.1", server.port, "/") | 166 client.post("127.0.0.1", server.port, "/") |
167 .then((request) { | 167 .then((request) { |
168 request.writeBytes([0]); | 168 request.add([0]); |
169 // TODO(sgjesse): Make this test work with | 169 // TODO(sgjesse): Make this test work with |
170 //request.response instead of request.close() return | 170 //request.response instead of request.close() return |
171 //return request.response; | 171 //return request.response; |
172 request.done.catchError((e) {}); | 172 request.done.catchError((e) {}); |
173 return request.close(); | 173 return request.close(); |
174 }) | 174 }) |
175 .then((response) { }) | 175 .then((response) { }) |
176 .catchError((e) { }, test: (e) => e is HttpParserException); | 176 .catchError((e) { }, test: (e) => e is HttpParserException); |
177 } | 177 } |
178 bool clientClosed = false; | 178 bool clientClosed = false; |
(...skipping 19 matching lines...) Expand all Loading... |
198 test1(10); | 198 test1(10); |
199 test2(1, 10); | 199 test2(1, 10); |
200 test2(10, 10); | 200 test2(10, 10); |
201 test2(10, 1000); | 201 test2(10, 1000); |
202 test3(1); | 202 test3(1); |
203 test3(10); | 203 test3(10); |
204 test4(); | 204 test4(); |
205 test5(1); | 205 test5(1); |
206 test5(10); | 206 test5(10); |
207 } | 207 } |
OLD | NEW |