| 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 import 'dart:math'; | 5 import 'dart:math'; |
| 6 | 6 |
| 7 part "../../../sdk/lib/io/input_stream.dart"; | 7 part "../../../sdk/lib/io/input_stream.dart"; |
| 8 part "../../../sdk/lib/io/output_stream.dart"; | 8 part "../../../sdk/lib/io/output_stream.dart"; |
| 9 part "../../../sdk/lib/io/chunked_stream.dart"; | 9 part "../../../sdk/lib/io/chunked_stream.dart"; |
| 10 part "../../../sdk/lib/io/string_stream.dart"; | 10 part "../../../sdk/lib/io/string_stream.dart"; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 void testEnumeration() { | 166 void testEnumeration() { |
| 167 _HttpHeaders headers = new _HttpHeaders(); | 167 _HttpHeaders headers = new _HttpHeaders(); |
| 168 Expect.isNull(headers[HttpHeaders.PRAGMA]); | 168 Expect.isNull(headers[HttpHeaders.PRAGMA]); |
| 169 headers.add("My-Header-1", "value 1"); | 169 headers.add("My-Header-1", "value 1"); |
| 170 headers.add("My-Header-2", "value 2"); | 170 headers.add("My-Header-2", "value 2"); |
| 171 headers.add("My-Header-1", "value 3"); | 171 headers.add("My-Header-1", "value 3"); |
| 172 bool myHeader1 = false; | 172 bool myHeader1 = false; |
| 173 bool myHeader2 = false; | 173 bool myHeader2 = false; |
| 174 int totalValues = 0; | 174 int totalValues = 0; |
| 175 headers.forEach(f(String name, List<String> values) { | 175 headers.forEach((String name, List<String> values) { |
| 176 totalValues += values.length; | 176 totalValues += values.length; |
| 177 if (name == "my-header-1") { | 177 if (name == "my-header-1") { |
| 178 myHeader1 = true; | 178 myHeader1 = true; |
| 179 Expect.isTrue(values.indexOf("value 1") != -1); | 179 Expect.isTrue(values.indexOf("value 1") != -1); |
| 180 Expect.isTrue(values.indexOf("value 3") != -1); | 180 Expect.isTrue(values.indexOf("value 3") != -1); |
| 181 } | 181 } |
| 182 if (name == "my-header-2") { | 182 if (name == "my-header-2") { |
| 183 myHeader2 = true; | 183 myHeader2 = true; |
| 184 Expect.isTrue(values.indexOf("value 2") != -1); | 184 Expect.isTrue(values.indexOf("value 2") != -1); |
| 185 } | 185 } |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 testIfModifiedSince(); | 402 testIfModifiedSince(); |
| 403 testHost(); | 403 testHost(); |
| 404 testEnumeration(); | 404 testEnumeration(); |
| 405 testHeaderValue(); | 405 testHeaderValue(); |
| 406 testContentType(); | 406 testContentType(); |
| 407 testContentTypeCache(); | 407 testContentTypeCache(); |
| 408 testCookie(); | 408 testCookie(); |
| 409 testInvalidCookie(); | 409 testInvalidCookie(); |
| 410 testHeaderLists(); | 410 testHeaderLists(); |
| 411 } | 411 } |
| OLD | NEW |