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

Unified Diff: base/i18n/time_formatting_unittest.cc

Issue 11709002: Linux: update expectations of TimeFormattingTest for ICU-50. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trying to fix win Created 7 years, 12 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 | no next file » | 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 76ffa5d178147f99ec300b2a5d398dc40582f911..1d4bc311f3cb8dea90622a5964a613435378caa8 100644
--- a/base/i18n/time_formatting_unittest.cc
+++ b/base/i18n/time_formatting_unittest.cc
@@ -8,6 +8,7 @@
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "unicode/uversion.h"
namespace base {
namespace {
@@ -57,7 +58,12 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayDefault24h) {
Time time(Time::FromLocalExploded(kTestDateTimeExploded));
string16 clock24h(ASCIIToUTF16("15:42"));
+#if U_ICU_VERSION_MAJOR_NUM >= 50
+ string16 clock12h_pm(ASCIIToUTF16("3:42 pm"));
+#else
+ // TODO(phajdan.jr): Clean up after bundled ICU gets updated to 50.
string16 clock12h_pm(ASCIIToUTF16("3:42 PM"));
+#endif
string16 clock12h(ASCIIToUTF16("3:42"));
// The default is 24h clock.
@@ -125,10 +131,25 @@ TEST(TimeFormattingTest, TimeFormatDateUS) {
EXPECT_EQ(ASCIIToUTF16("Apr 30, 2011"), TimeFormatShortDate(time));
EXPECT_EQ(ASCIIToUTF16("4/30/11"), TimeFormatShortDateNumeric(time));
+
+#if U_ICU_VERSION_MAJOR_NUM >= 50
+ EXPECT_EQ(ASCIIToUTF16("4/30/11, 3:42:07 PM"),
+ TimeFormatShortDateAndTime(time));
+#else
+ // TODO(phajdan.jr): Clean up after bundled ICU gets updated to 50.
EXPECT_EQ(ASCIIToUTF16("4/30/11 3:42:07 PM"),
TimeFormatShortDateAndTime(time));
+#endif
+
+#if U_ICU_VERSION_MAJOR_NUM >= 50
+ EXPECT_EQ(ASCIIToUTF16("Saturday, April 30, 2011 at 3:42:07 PM"),
+ TimeFormatFriendlyDateAndTime(time));
+#else
+ // TODO(phajdan.jr): Clean up after bundled ICU gets updated to 50.
EXPECT_EQ(ASCIIToUTF16("Saturday, April 30, 2011 3:42:07 PM"),
TimeFormatFriendlyDateAndTime(time));
+#endif
+
EXPECT_EQ(ASCIIToUTF16("Saturday, April 30, 2011"),
TimeFormatFriendlyDate(time));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698