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

Unified Diff: i18n/time_formatting_unittest.cc

Issue 2043183002: Update to Chromium //base at Chromium commit 01cb97b2e09618bbc3a60c7348f0a844eea20547. (Closed) Base URL: https://github.com/domokit/base.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 | « i18n/number_formatting_unittest.cc ('k') | memory/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: i18n/time_formatting_unittest.cc
diff --git a/i18n/time_formatting_unittest.cc b/i18n/time_formatting_unittest.cc
index 93856280d9a94dc24e8188320360c6a8874b0ec8..7b7d4d54d2207eacb4999688b3110f5572de770a 100644
--- a/i18n/time_formatting_unittest.cc
+++ b/i18n/time_formatting_unittest.cc
@@ -7,6 +7,7 @@
#include "base/i18n/rtl.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/icu_test_util.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/icu/source/common/unicode/uversion.h"
@@ -41,6 +42,7 @@ base::string16 GetShortTimeZone(const Time& time) {
TEST(TimeFormattingTest, TimeFormatTimeOfDayDefault12h) {
// Test for a locale defaulted to 12h clock.
// As an instance, we use third_party/icu/source/data/locales/en.txt.
+ test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_US");
Time time(Time::FromLocalExploded(kTestDateTimeExploded));
@@ -76,6 +78,7 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayDefault12h) {
TEST(TimeFormattingTest, TimeFormatTimeOfDayDefault24h) {
// Test for a locale defaulted to 24h clock.
// As an instance, we use third_party/icu/source/data/locales/en_GB.txt.
+ test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_GB");
Time time(Time::FromLocalExploded(kTestDateTimeExploded));
@@ -111,6 +114,7 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayDefault24h) {
TEST(TimeFormattingTest, TimeFormatTimeOfDayJP) {
// Test for a locale that uses different mark than "AM" and "PM".
// As an instance, we use third_party/icu/source/data/locales/ja.txt.
+ test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("ja_JP");
Time time(Time::FromLocalExploded(kTestDateTimeExploded));
@@ -144,6 +148,7 @@ TEST(TimeFormattingTest, TimeFormatTimeOfDayJP) {
TEST(TimeFormattingTest, TimeFormatDateUS) {
// See third_party/icu/source/data/locales/en.txt.
// The date patterns are "EEEE, MMMM d, y", "MMM d, y", and "M/d/yy".
+ test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_US");
Time time(Time::FromLocalExploded(kTestDateTimeExploded));
@@ -166,6 +171,7 @@ TEST(TimeFormattingTest, TimeFormatDateUS) {
TEST(TimeFormattingTest, TimeFormatDateGB) {
// See third_party/icu/source/data/locales/en_GB.txt.
// The date patterns are "EEEE, d MMMM y", "d MMM y", and "dd/MM/yyyy".
+ test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_GB");
Time time(Time::FromLocalExploded(kTestDateTimeExploded));
« no previous file with comments | « i18n/number_formatting_unittest.cc ('k') | memory/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698