| 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 library dart.io; | 5 library dart.io; |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import "dart:async"; | 8 import "dart:async"; |
| 9 import "dart:collection"; | 9 import "dart:collection"; |
| 10 import "dart:convert"; | 10 import "dart:convert"; |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 test("SID", "sJdkjKSJD12343kjKj78"); | 429 test("SID", "sJdkjKSJD12343kjKj78"); |
| 430 } | 430 } |
| 431 | 431 |
| 432 void testInvalidCookie() { | 432 void testInvalidCookie() { |
| 433 Expect.throws(() => new _Cookie.fromSetCookieValue("")); | 433 Expect.throws(() => new _Cookie.fromSetCookieValue("")); |
| 434 Expect.throws(() => new _Cookie.fromSetCookieValue("=")); | 434 Expect.throws(() => new _Cookie.fromSetCookieValue("=")); |
| 435 Expect.throws(() => new _Cookie.fromSetCookieValue("=xxx")); | 435 Expect.throws(() => new _Cookie.fromSetCookieValue("=xxx")); |
| 436 Expect.throws(() => new _Cookie.fromSetCookieValue("xxx")); | 436 Expect.throws(() => new _Cookie.fromSetCookieValue("xxx")); |
| 437 Expect.throws(() => new _Cookie.fromSetCookieValue( | 437 Expect.throws(() => new _Cookie.fromSetCookieValue( |
| 438 "xxx=yyy; expires=12 jan 2013")); | 438 "xxx=yyy; expires=12 jan 2013")); |
| 439 |
| 440 _HttpHeaders headers = new _HttpHeaders("1.1"); |
| 441 headers.set('Cookie', |
| 442 'DARTSESSID=d3d6fdd78d51aaaf2924c32e991f4349; undefined'); |
| 443 Expect.equals('DARTSESSID', headers._parseCookies().single.name); |
| 444 Expect.equals('d3d6fdd78d51aaaf2924c32e991f4349', |
| 445 headers._parseCookies().single.value); |
| 439 } | 446 } |
| 440 | 447 |
| 441 void testHeaderLists() { | 448 void testHeaderLists() { |
| 442 HttpHeaders.GENERAL_HEADERS.forEach((x) => null); | 449 HttpHeaders.GENERAL_HEADERS.forEach((x) => null); |
| 443 HttpHeaders.ENTITY_HEADERS.forEach((x) => null); | 450 HttpHeaders.ENTITY_HEADERS.forEach((x) => null); |
| 444 HttpHeaders.RESPONSE_HEADERS.forEach((x) => null); | 451 HttpHeaders.RESPONSE_HEADERS.forEach((x) => null); |
| 445 HttpHeaders.REQUEST_HEADERS.forEach((x) => null); | 452 HttpHeaders.REQUEST_HEADERS.forEach((x) => null); |
| 446 } | 453 } |
| 447 | 454 |
| 448 main() { | 455 main() { |
| 449 testMultiValue(); | 456 testMultiValue(); |
| 450 testDate(); | 457 testDate(); |
| 451 testExpires(); | 458 testExpires(); |
| 452 testIfModifiedSince(); | 459 testIfModifiedSince(); |
| 453 testHost(); | 460 testHost(); |
| 454 testEnumeration(); | 461 testEnumeration(); |
| 455 testHeaderValue(); | 462 testHeaderValue(); |
| 456 testContentType(); | 463 testContentType(); |
| 457 testContentTypeCache(); | 464 testContentTypeCache(); |
| 458 testCookie(); | 465 testCookie(); |
| 459 testInvalidCookie(); | 466 testInvalidCookie(); |
| 460 testHeaderLists(); | 467 testHeaderLists(); |
| 461 } | 468 } |
| OLD | NEW |