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

Unified Diff: test/mjsunit/regress/regress-crbug-364374.js

Issue 1529363005: tzname check fix (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: todo comment added for Etc/GMT{offset} Created 5 years 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
« no previous file with comments | « test/mjsunit/regress/regress-487322.js ('k') | test/mjsunit/regress/regress-crbug-487322.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-364374.js
diff --git a/test/mjsunit/regress/regress-crbug-364374.js b/test/mjsunit/regress/regress-crbug-364374.js
new file mode 100644
index 0000000000000000000000000000000000000000..d8ae91fffefcbd5d7fb6b4609741c737bb0dac8d
--- /dev/null
+++ b/test/mjsunit/regress/regress-crbug-364374.js
@@ -0,0 +1,56 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+if (this.Intl) {
+ // chromium:364374
+
+ // Locations with 2 underscores are accepted and normalized.
+ // 'of' and 'es' are always lowercased.
+ df = new Intl.DateTimeFormat('en-US', {'timeZone': 'eUrope/isLe_OF_man'})
+ assertEquals('Europe/Isle_of_Man', df.resolvedOptions().timeZone);
+
+ df = new Intl.DateTimeFormat('en-US', {'timeZone': 'africa/Dar_eS_salaam'})
+ assertEquals('Africa/Dar_es_Salaam', df.resolvedOptions().timeZone);
+
+ df = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/port_of_spain'})
+ assertEquals('America/Port_of_Spain', df.resolvedOptions().timeZone);
+
+ // Zone ids with more than 2 parts are accepted and normalized.
+ df = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/north_Dakota/new_salem'})
+ assertEquals('America/North_Dakota/New_Salem', df.resolvedOptions().timeZone);
+
+ // 3-part zone IDs are accepted and normalized.
+ // Two Buenose Aires aliases are identical.
+ df1 = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/aRgentina/buenos_aIres'})
+ df2 = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/Argentina/Buenos_Aires'})
+ assertEquals(df1.resolvedOptions().timeZone, df2.resolvedOptions().timeZone);
+
+ df2 = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/Buenos_Aires'})
+ assertEquals(df1.resolvedOptions().timeZone, df2.resolvedOptions().timeZone);
+
+ df1 = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/Indiana/Indianapolis'})
+ df2 = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/Indianapolis'})
+ assertEquals(df1.resolvedOptions().timeZone, df2.resolvedOptions().timeZone);
+
+ // ICU does not recognize East-Indiana. Add later when it does.
+ // df2 = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/East-Indiana'})
+ // assertEquals(df1.resolvedOptions().timeZone, df2.resolvedOptions().timeZone);
+
+
+ // Zone IDs with hyphens. 'au' has to be in lowercase.
+ df = new Intl.DateTimeFormat('en-US', {'timeZone': 'America/port-aU-pRince'})
+ assertEquals('America/Port-au-Prince', df.resolvedOptions().timeZone);
+
+ // Accepts Ho_Chi_Minh and treats it as identical to Saigon
+ df1 = new Intl.DateTimeFormat('en-US', {'timeZone': 'Asia/Ho_Chi_Minh'})
+ df2 = new Intl.DateTimeFormat('en-US', {'timeZone': 'Asia/Saigon'})
+ assertEquals(df1.resolvedOptions().timeZone, df2.resolvedOptions().timeZone);
+
+ // Throws for invalid timezone ids.
+ assertThrows(() => Intl.DateTimeFormat(undefined, {timeZone: 'Europe/_Paris'}));
+ assertThrows(() => Intl.DateTimeFormat(undefined, {timeZone: 'America/New__York'}));
+ assertThrows(() => Intl.DateTimeFormat(undefined, {timeZone: 'America//New_York'}));
+ assertThrows(() => Intl.DateTimeFormat(undefined, {timeZone: 'America/New_York_'}));
+ assertThrows(() => Intl.DateTimeFormat(undefined, {timeZone: 'America/New_Y0rk'}));
+}
« no previous file with comments | « test/mjsunit/regress/regress-487322.js ('k') | test/mjsunit/regress/regress-crbug-487322.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698