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

Unified Diff: base/i18n/time_formatting_unittest.cc

Issue 2086393003: Make callers of FromUTC(Local)Exploded in base/ use new time API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('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 51eebc26cf698c600531d358fa64eec725241f0d..51a48513aca6c10d4610501f4f29a861dc0a1fb9 100644
--- a/base/i18n/time_formatting_unittest.cc
+++ b/base/i18n/time_formatting_unittest.cc
@@ -52,7 +52,8 @@ TEST(TimeFormattingTest, MAYBE_TimeFormatTimeOfDayDefault12h) {
test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_US");
- Time time(Time::FromLocalExploded(kTestDateTimeExploded));
+ Time time;
+ EXPECT_TRUE(Time::FromLocalExploded(kTestDateTimeExploded, &time));
string16 clock24h(ASCIIToUTF16("15:42"));
string16 clock12h_pm(ASCIIToUTF16("3:42 PM"));
string16 clock12h(ASCIIToUTF16("3:42"));
@@ -94,7 +95,8 @@ TEST(TimeFormattingTest, MAYBE_TimeFormatTimeOfDayDefault24h) {
test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_GB");
- Time time(Time::FromLocalExploded(kTestDateTimeExploded));
+ Time time;
+ EXPECT_TRUE(Time::FromLocalExploded(kTestDateTimeExploded, &time));
string16 clock24h(ASCIIToUTF16("15:42"));
string16 clock12h_pm(ASCIIToUTF16("3:42 pm"));
string16 clock12h(ASCIIToUTF16("3:42"));
@@ -135,7 +137,8 @@ TEST(TimeFormattingTest, MAYBE_TimeFormatTimeOfDayJP) {
test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("ja_JP");
- Time time(Time::FromLocalExploded(kTestDateTimeExploded));
+ Time time;
+ EXPECT_TRUE(Time::FromLocalExploded(kTestDateTimeExploded, &time));
string16 clock24h(ASCIIToUTF16("15:42"));
string16 clock12h_pm(WideToUTF16(L"\x5348\x5f8c" L"3:42"));
string16 clock12h(ASCIIToUTF16("3:42"));
@@ -174,7 +177,8 @@ TEST(TimeFormattingTest, MAYBE_TimeFormatDateUS) {
test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_US");
- Time time(Time::FromLocalExploded(kTestDateTimeExploded));
+ Time time;
+ EXPECT_TRUE(Time::FromLocalExploded(kTestDateTimeExploded, &time));
EXPECT_EQ(ASCIIToUTF16("Apr 30, 2011"), TimeFormatShortDate(time));
EXPECT_EQ(ASCIIToUTF16("4/30/11"), TimeFormatShortDateNumeric(time));
@@ -202,7 +206,8 @@ TEST(TimeFormattingTest, MAYBE_TimeFormatDateGB) {
test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_GB");
- Time time(Time::FromLocalExploded(kTestDateTimeExploded));
+ Time time;
+ EXPECT_TRUE(Time::FromLocalExploded(kTestDateTimeExploded, &time));
EXPECT_EQ(ASCIIToUTF16("30 Apr 2011"), TimeFormatShortDate(time));
EXPECT_EQ(ASCIIToUTF16("30/04/2011"), TimeFormatShortDateNumeric(time));
« no previous file with comments | « no previous file | base/metrics/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698