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 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 17 matching lines...) Expand all Loading... |
28 part "../../../sdk/lib/io/http_parser.dart"; | 28 part "../../../sdk/lib/io/http_parser.dart"; |
29 part "../../../sdk/lib/io/http_headers.dart"; | 29 part "../../../sdk/lib/io/http_headers.dart"; |
30 part "../../../sdk/lib/io/http_session.dart"; | 30 part "../../../sdk/lib/io/http_session.dart"; |
31 part "../../../sdk/lib/io/io_service.dart"; | 31 part "../../../sdk/lib/io/io_service.dart"; |
32 part "../../../sdk/lib/io/io_sink.dart"; | 32 part "../../../sdk/lib/io/io_sink.dart"; |
33 part "../../../sdk/lib/io/platform.dart"; | 33 part "../../../sdk/lib/io/platform.dart"; |
34 part "../../../sdk/lib/io/platform_impl.dart"; | 34 part "../../../sdk/lib/io/platform_impl.dart"; |
35 part "../../../sdk/lib/io/service_object.dart"; | 35 part "../../../sdk/lib/io/service_object.dart"; |
36 part "../../../sdk/lib/io/secure_socket.dart"; | 36 part "../../../sdk/lib/io/secure_socket.dart"; |
37 part "../../../sdk/lib/io/secure_server_socket.dart"; | 37 part "../../../sdk/lib/io/secure_server_socket.dart"; |
| 38 part "../../../sdk/lib/io/security_context.dart"; |
38 part "../../../sdk/lib/io/socket.dart"; | 39 part "../../../sdk/lib/io/socket.dart"; |
39 | 40 |
40 void testParseHttpCookieDate() { | 41 void testParseHttpCookieDate() { |
41 Expect.throws(() => HttpDate._parseCookieDate("")); | 42 Expect.throws(() => HttpDate._parseCookieDate("")); |
42 | 43 |
43 test(int year, | 44 test(int year, |
44 int month, | 45 int month, |
45 int day, | 46 int day, |
46 int hours, | 47 int hours, |
47 int minutes, | 48 int minutes, |
48 int seconds, | 49 int seconds, |
49 String formatted) { | 50 String formatted) { |
50 DateTime date = | 51 DateTime date = |
51 new DateTime.utc(year, month, day, hours, minutes, seconds, 0); | 52 new DateTime.utc(year, month, day, hours, minutes, seconds, 0); |
52 Expect.equals(date, HttpDate._parseCookieDate(formatted)); | 53 Expect.equals(date, HttpDate._parseCookieDate(formatted)); |
53 } | 54 } |
54 | 55 |
55 test(2012, DateTime.JUNE, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt"); | 56 test(2012, DateTime.JUNE, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt"); |
56 test(2021, DateTime.JUNE, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT"); | 57 test(2021, DateTime.JUNE, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT"); |
57 test(2021, DateTime.JANUARY, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT"); | 58 test(2021, DateTime.JANUARY, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT"); |
58 test(2013, DateTime.JANUARY, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT"); | 59 test(2013, DateTime.JANUARY, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT"); |
59 test(1970, DateTime.JANUARY, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT"); | 60 test(1970, DateTime.JANUARY, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT"); |
60 } | 61 } |
61 | 62 |
62 void main() { | 63 void main() { |
63 testParseHttpCookieDate(); | 64 testParseHttpCookieDate(); |
64 } | 65 } |
OLD | NEW |