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

Unified Diff: test/intl/date-format/parse-mdy.js

Issue 25855005: Fixing timezone issues with date-time/parse-* tests. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updating testcfg.py so it doesn't load deleted utils.js file Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: test/intl/date-format/parse-mdy.js
diff --git a/test/intl/date-format/parse-mdy.js b/test/intl/date-format/parse-mdy.js
index e767a0b2d2508af0a5c812ab47276f473f773bc9..788a7bbd08cd196797fb387e08c4b82325cced58 100644
--- a/test/intl/date-format/parse-mdy.js
+++ b/test/intl/date-format/parse-mdy.js
@@ -27,23 +27,25 @@
// Testing v8Parse method for date only.
-var dtf = new Intl.DateTimeFormat(['en']);
+function checkDate(date) {
+ assertEquals(1974, date.getFullYear());
mnita 2013/10/08 20:04:41 Should we go with UTC fields, for consistency?
+ assertEquals(1, date.getMonth());
+ assertEquals(4, date.getDate());
+}
+
+var dtf = new Intl.DateTimeFormat(['en'], {timeZone: 'America/Los_Angeles'});
// Make sure we have pattern we expect (may change in the future).
assertEquals('M/d/y', dtf.resolved.pattern);
-assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
- usePDT(String(dtf.v8Parse('5/4/74'))));
-assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
- usePDT(String(dtf.v8Parse('05/04/74'))));
-assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
- usePDT(String(dtf.v8Parse('5/04/74'))));
-assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
- usePDT(String(dtf.v8Parse('5/4/1974'))));
-
-// Month is numeric, so it fails on "May".
-assertEquals(undefined, dtf.v8Parse('May 4th 1974'));
+checkDate(dtf.v8Parse('2/4/74'));
+checkDate(dtf.v8Parse('02/04/74'));
+checkDate(dtf.v8Parse('2/04/74'));
+checkDate(dtf.v8Parse('02/4/74'));
+checkDate(dtf.v8Parse('2/4/1974'));
+checkDate(dtf.v8Parse('02/4/1974'));
+checkDate(dtf.v8Parse('2/04/1974'));
+checkDate(dtf.v8Parse('02/04/1974'));
-// Time is ignored from the input, since the pattern doesn't have it.
-assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
- usePDT(String(dtf.v8Parse('5/4/74 12:30:12'))));
+// Month is numeric, so it fails on "Feb".
+assertEquals(undefined, dtf.v8Parse('Feb 4th 1974'));

Powered by Google App Engine
This is Rietveld 408576698