Chromium Code Reviews| Index: tests/standalone/io/http_date_test.dart |
| diff --git a/tests/standalone/io/http_date_test.dart b/tests/standalone/io/http_date_test.dart |
| index 9b8be0a8453c9c9e324ea2ec0c83de659ccb0e1e..899553a616474247a81934220f59fb255c26ab79 100644 |
| --- a/tests/standalone/io/http_date_test.dart |
| +++ b/tests/standalone/io/http_date_test.dart |
| @@ -85,8 +85,30 @@ void testParseHttpDateFailures() { |
| }); |
| } |
| +void testParseHttpCookieDate() { |
| + Expect.throws(() => _HttpUtils.parseCookieDate("")); |
| + |
| + test(int year, |
| + int month, |
| + int day, |
| + int hours, |
| + int minutes, |
| + int seconds, |
| + String formatted) { |
| + Date date = new Date(year, month, day, hours, minutes, seconds, 0, isUtc: true); |
|
Søren Gjesse
2012/09/04 06:51:57
Long line.
Anders Johnsen
2012/09/04 07:03:13
Done.
|
| + Expect.equals(date, _HttpUtils.parseCookieDate(formatted)); |
| + } |
| + |
| + test(2012, Date.JUN, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt"); |
| + test(2021, Date.JUN, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT"); |
| + test(2021, Date.JAN, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT"); |
| + test(2013, Date.JAN, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT"); |
| + test(1970, Date.JAN, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT"); |
| +} |
| + |
| void main() { |
| testParseHttpDate(); |
| testFormatParseHttpDate(); |
| testParseHttpDateFailures(); |
| + testParseHttpCookieDate(); |
| } |