| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.add([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 HttpException); |
| 177 } | 177 } |
| 178 bool clientClosed = false; | 178 bool clientClosed = false; |
| 179 new Timer.periodic(new Duration(milliseconds: 100), (timer) { | 179 new Timer.periodic(new Duration(milliseconds: 100), (timer) { |
| 180 if (!clientClosed) { | 180 if (!clientClosed) { |
| 181 if (server.connectionsInfo().total == totalConnections) { | 181 if (server.connectionsInfo().total == totalConnections) { |
| 182 clientClosed = true; | 182 clientClosed = true; |
| 183 client.close(force: true); | 183 client.close(force: true); |
| 184 } | 184 } |
| 185 } else { | 185 } else { |
| 186 if (server.connectionsInfo().total == 0) { | 186 if (server.connectionsInfo().total == 0) { |
| (...skipping 11 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 |