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

Unified Diff: base/i18n/time_formatting_unittest.cc

Issue 2607043002: [Autofill] Credit Card Autofill Last Used Date Experiment (Closed)
Patch Set: Addressed comments Created 3 years, 10 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
« no previous file with comments | « base/i18n/time_formatting.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/time_formatting_unittest.cc
diff --git a/base/i18n/time_formatting_unittest.cc b/base/i18n/time_formatting_unittest.cc
index 06cd77284a61b388e0f12f13778dda8da3f4862b..0e9f146e7641830ac51d499a53e1b6d3ad59ab9e 100644
--- a/base/i18n/time_formatting_unittest.cc
+++ b/base/i18n/time_formatting_unittest.cc
@@ -224,6 +224,29 @@ TEST(TimeFormattingTest, MAYBE_TimeFormatDateGB) {
TimeFormatFriendlyDate(time));
}
+TEST(TimeFormattingTest, TimeFormatWithPattern) {
+ test::ScopedRestoreICUDefaultLocale restore_locale;
+
+ Time time;
+ EXPECT_TRUE(Time::FromLocalExploded(kTestDateTimeExploded, &time));
+
+ i18n::SetICUDefaultLocale("en_US");
+ EXPECT_EQ(ASCIIToUTF16("Apr 30, 2011"), TimeFormatWithPattern(time, "yMMMd"));
+ EXPECT_EQ(ASCIIToUTF16("April 30, 3:42:07 PM"),
+ TimeFormatWithPattern(time, "MMMMdjmmss"));
+
+ i18n::SetICUDefaultLocale("en_GB");
+ EXPECT_EQ(ASCIIToUTF16("30 Apr 2011"), TimeFormatWithPattern(time, "yMMMd"));
+ EXPECT_EQ(ASCIIToUTF16("30 April, 15:42:07"),
+ TimeFormatWithPattern(time, "MMMMdjmmss"));
+
+ i18n::SetICUDefaultLocale("ja_JP");
+ EXPECT_EQ(WideToUTF16(L"2011年4月30日"),
+ TimeFormatWithPattern(time, "yMMMd"));
+ EXPECT_EQ(WideToUTF16(L"4月30日") + ASCIIToUTF16(" 15:42:07"),
+ TimeFormatWithPattern(time, "MMMMdjmmss"));
+}
+
TEST(TimeFormattingTest, TimeDurationFormat) {
test::ScopedRestoreICUDefaultLocale restore_locale;
TimeDelta delta = TimeDelta::FromMinutes(15 * 60 + 42);
« no previous file with comments | « base/i18n/time_formatting.cc ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698