Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: tests/standalone/io/http_cookie_date_test.dart

Issue 16812004: Make some HTTP utility functions public (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: One more status file update Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/lib/analyzer/analyze_tests.status ('k') | tests/standalone/io/http_date_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import "package:expect/expect.dart";
6 import "dart:async";
7 import "dart:math";
8
9 part '../../../sdk/lib/io/common.dart';
10 part "../../../sdk/lib/io/io_sink.dart";
11 part "../../../sdk/lib/io/http.dart";
12 part "../../../sdk/lib/io/http_impl.dart";
13 part "../../../sdk/lib/io/http_parser.dart";
14 part "../../../sdk/lib/io/http_utils.dart";
15 part "../../../sdk/lib/io/socket.dart";
16
17 void testParseHttpCookieDate() {
18 Expect.throws(() => _HttpUtils.parseCookieDate(""));
19
20 test(int year,
21 int month,
22 int day,
23 int hours,
24 int minutes,
25 int seconds,
26 String formatted) {
27 DateTime date = new DateTime.utc(year, month, day, hours, minutes, seconds, 0);
28 Expect.equals(date, _HttpUtils.parseCookieDate(formatted));
29 }
30
31 test(2012, DateTime.JUNE, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt");
32 test(2021, DateTime.JUNE, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT");
33 test(2021, DateTime.JANUARY, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT");
34 test(2013, DateTime.JANUARY, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT");
35 test(1970, DateTime.JANUARY, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT");
36 }
37
38 void main() {
39 testParseHttpCookieDate();
40 }
OLDNEW
« no previous file with comments | « tests/lib/analyzer/analyze_tests.status ('k') | tests/standalone/io/http_date_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698