OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #source("../../../../runtime/bin/input_stream.dart"); | 5 #source("../../../runtime/bin/input_stream.dart"); |
6 #source("../../../../runtime/bin/output_stream.dart"); | 6 #source("../../../runtime/bin/output_stream.dart"); |
7 #source("../../../../runtime/bin/chunked_stream.dart"); | 7 #source("../../../runtime/bin/chunked_stream.dart"); |
8 #source("../../../../runtime/bin/string_stream.dart"); | 8 #source("../../../runtime/bin/string_stream.dart"); |
9 #source("../../../../runtime/bin/stream_util.dart"); | 9 #source("../../../runtime/bin/stream_util.dart"); |
10 #source("../../../../runtime/bin/http.dart"); | 10 #source("../../../runtime/bin/http.dart"); |
11 #source("../../../../runtime/bin/http_impl.dart"); | 11 #source("../../../runtime/bin/http_impl.dart"); |
12 #source("../../../../runtime/bin/http_parser.dart"); | 12 #source("../../../runtime/bin/http_parser.dart"); |
13 #source("../../../../runtime/bin/http_utils.dart"); | 13 #source("../../../runtime/bin/http_utils.dart"); |
14 | 14 |
15 void testMultiValue() { | 15 void testMultiValue() { |
16 _HttpHeaders headers = new _HttpHeaders(); | 16 _HttpHeaders headers = new _HttpHeaders(); |
17 Expect.isNull(headers[HttpHeaders.PRAGMA]); | 17 Expect.isNull(headers[HttpHeaders.PRAGMA]); |
18 headers.add(HttpHeaders.PRAGMA, "pragma1"); | 18 headers.add(HttpHeaders.PRAGMA, "pragma1"); |
19 Expect.equals(1, headers[HttpHeaders.PRAGMA].length); | 19 Expect.equals(1, headers[HttpHeaders.PRAGMA].length); |
20 Expect.equals(1, headers["pragma"].length); | 20 Expect.equals(1, headers["pragma"].length); |
21 Expect.equals(1, headers["Pragma"].length); | 21 Expect.equals(1, headers["Pragma"].length); |
22 Expect.equals(1, headers["PRAGMA"].length); | 22 Expect.equals(1, headers["PRAGMA"].length); |
23 Expect.equals("pragma1", headers.value(HttpHeaders.PRAGMA)); | 23 Expect.equals("pragma1", headers.value(HttpHeaders.PRAGMA)); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 Expect.equals(":1234", headers.value(HttpHeaders.HOST)); | 137 Expect.equals(":1234", headers.value(HttpHeaders.HOST)); |
138 Expect.isNull(headers.host); | 138 Expect.isNull(headers.host); |
139 Expect.equals(1234, headers.port); | 139 Expect.equals(1234, headers.port); |
140 } | 140 } |
141 | 141 |
142 main() { | 142 main() { |
143 testMultiValue(); | 143 testMultiValue(); |
144 testExpires(); | 144 testExpires(); |
145 testHost(); | 145 testHost(); |
146 } | 146 } |
OLD | NEW |