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 import "package:expect/expect.dart"; | |
6 import "dart:isolate"; | 5 import "dart:isolate"; |
7 import "dart:io"; | 6 import "dart:io"; |
8 | 7 |
9 void testNoBody(int totalConnections, bool explicitContentLength) { | 8 void testNoBody(int totalConnections, bool explicitContentLength) { |
10 var errors = 0; | 9 var errors = 0; |
11 HttpServer.bind("127.0.0.1", 0, totalConnections).then((server) { | 10 HttpServer.bind("127.0.0.1", 0, totalConnections).then((server) { |
12 server.listen( | 11 server.listen( |
13 (HttpRequest request) { | 12 (HttpRequest request) { |
14 Expect.equals("0", request.headers.value('content-length')); | 13 Expect.equals("0", request.headers.value('content-length')); |
15 Expect.equals(0, request.contentLength); | 14 Expect.equals(0, request.contentLength); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 232 |
234 void main() { | 233 void main() { |
235 testNoBody(5, false); | 234 testNoBody(5, false); |
236 testNoBody(5, true); | 235 testNoBody(5, true); |
237 testBody(5, false); | 236 testBody(5, false); |
238 testBody(5, true); | 237 testBody(5, true); |
239 testBodyChunked(5, false); | 238 testBodyChunked(5, false); |
240 testBodyChunked(5, true); | 239 testBodyChunked(5, true); |
241 testSetContentLength(); | 240 testSetContentLength(); |
242 } | 241 } |
OLD | NEW |