| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 .fold(0, (s, b) => s + b.length) | 267 .fold(0, (s, b) => s + b.length) |
| 268 .then((bytes) { | 268 .then((bytes) { |
| 269 Expect.equals(8, bytes); | 269 Expect.equals(8, bytes); |
| 270 server.close(); | 270 server.close(); |
| 271 }); | 271 }); |
| 272 }); | 272 }); |
| 273 }); | 273 }); |
| 274 } | 274 } |
| 275 | 275 |
| 276 | 276 |
| 277 void testBadHeaders() { |
| 278 testServerRequest((server, request) { |
| 279 var value = "a"; |
| 280 for (int i = 0; i < 8 * 1024; i++) { |
| 281 value += 'a'; |
| 282 } |
| 283 request.response.headers.set('name', value); |
| 284 request.response.close().catchError((error) { |
| 285 server.close(); |
| 286 }, test: (e) => e is HttpException); |
| 287 }); |
| 288 } |
| 289 |
| 290 |
| 277 void main() { | 291 void main() { |
| 278 testResponseDone(); | 292 testResponseDone(); |
| 279 testResponseAddStream(); | 293 testResponseAddStream(); |
| 280 testResponseAddStreamClosed(); | 294 testResponseAddStreamClosed(); |
| 281 testResponseAddClosed(); | 295 testResponseAddClosed(); |
| 282 testBadResponseAdd(); | 296 testBadResponseAdd(); |
| 283 testBadResponseClose(); | 297 testBadResponseClose(); |
| 284 testIgnoreRequestData(); | 298 testIgnoreRequestData(); |
| 299 testBadHeaders(); |
| 285 } | 300 } |
| OLD | NEW |