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 | 5 |
6 import "package:expect/expect.dart"; | |
7 import "dart:isolate"; | 6 import "dart:isolate"; |
8 import "dart:io"; | 7 import "dart:io"; |
9 | 8 |
10 void test(int totalConnections, [String body]) { | 9 void test(int totalConnections, [String body]) { |
11 HttpServer.bind().then((server) { | 10 HttpServer.bind().then((server) { |
12 | 11 |
13 server.listen((HttpRequest request) { | 12 server.listen((HttpRequest request) { |
14 HttpResponse response = request.response; | 13 HttpResponse response = request.response; |
15 // Cannot mutate request headers. | 14 // Cannot mutate request headers. |
16 Expect.throws(() => request.headers.add("X-Request-Header", "value"), | 15 Expect.throws(() => request.headers.add("X-Request-Header", "value"), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 }); | 71 }); |
73 } | 72 } |
74 | 73 |
75 }); | 74 }); |
76 } | 75 } |
77 | 76 |
78 void main() { | 77 void main() { |
79 test(5); | 78 test(5); |
80 test(5, "Hello and goodbye"); | 79 test(5, "Hello and goodbye"); |
81 } | 80 } |
OLD | NEW |