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

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

Issue 18576006: Remove _HttpUtils from dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated comments and add encoding tests. Created 7 years, 5 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/standalone/io/http_body_test.dart ('k') | tests/standalone/io/http_headers_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
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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:async"; 6 import "dart:async";
7 import "dart:math"; 7 import "dart:math";
8 import "dart:collection"; 8 import "dart:collection";
9 9
10 part "../../../sdk/lib/io/common.dart"; 10 part "../../../sdk/lib/io/common.dart";
11 part "../../../sdk/lib/io/io_sink.dart"; 11 part "../../../sdk/lib/io/io_sink.dart";
12 part "../../../sdk/lib/io/http.dart"; 12 part "../../../sdk/lib/io/http.dart";
13 part "../../../sdk/lib/io/http_impl.dart"; 13 part "../../../sdk/lib/io/http_impl.dart";
14 part "../../../sdk/lib/io/http_parser.dart"; 14 part "../../../sdk/lib/io/http_parser.dart";
15 part "../../../sdk/lib/io/http_utils.dart"; 15 part "../../../sdk/lib/io/http_date.dart";
16 part "../../../sdk/lib/io/socket.dart"; 16 part "../../../sdk/lib/io/socket.dart";
17 17
18 void testParseHttpCookieDate() { 18 void testParseHttpCookieDate() {
19 Expect.throws(() => _HttpUtils.parseCookieDate("")); 19 Expect.throws(() => HttpDate._parseCookieDate(""));
20 20
21 test(int year, 21 test(int year,
22 int month, 22 int month,
23 int day, 23 int day,
24 int hours, 24 int hours,
25 int minutes, 25 int minutes,
26 int seconds, 26 int seconds,
27 String formatted) { 27 String formatted) {
28 DateTime date = new DateTime.utc(year, month, day, hours, minutes, seconds, 0); 28 DateTime date = new DateTime.utc(year, month, day, hours, minutes, seconds, 0);
29 Expect.equals(date, _HttpUtils.parseCookieDate(formatted)); 29 Expect.equals(date, HttpDate._parseCookieDate(formatted));
30 } 30 }
31 31
32 test(2012, DateTime.JUNE, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt"); 32 test(2012, DateTime.JUNE, 19, 14, 15, 01, "tue, 19-jun-12 14:15:01 gmt");
33 test(2021, DateTime.JUNE, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT"); 33 test(2021, DateTime.JUNE, 09, 10, 18, 14, "Wed, 09-Jun-2021 10:18:14 GMT");
34 test(2021, DateTime.JANUARY, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT"); 34 test(2021, DateTime.JANUARY, 13, 22, 23, 01, "Wed, 13-Jan-2021 22:23:01 GMT");
35 test(2013, DateTime.JANUARY, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT"); 35 test(2013, DateTime.JANUARY, 15, 21, 47, 38, "Tue, 15-Jan-2013 21:47:38 GMT");
36 test(1970, DateTime.JANUARY, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT"); 36 test(1970, DateTime.JANUARY, 01, 00, 00, 01, "Thu, 01-Jan-1970 00:00:01 GMT");
37 } 37 }
38 38
39 void main() { 39 void main() {
40 testParseHttpCookieDate(); 40 testParseHttpCookieDate();
41 } 41 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_body_test.dart ('k') | tests/standalone/io/http_headers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698