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

Unified Diff: base/test/test_suite.cc

Issue 878723002: Upgrade ICU to 54.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add en-GB display name test Created 5 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_unittest.cc ('k') | build/secondary/third_party/icu/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/test_suite.cc
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index 903e93ea07a7b8aba49e66f49603dcda88bdae89..d40dd983eb6b143fdbf97466ce25e66ec2be92dc 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -35,6 +35,14 @@
#endif // OS_IOS
#endif // OS_MACOSX
+#if !defined(OS_WIN)
+#include "base/i18n/rtl.h"
+#if !defined(OS_IOS)
+#include "base/strings/string_util.h"
+#include "third_party/icu/source/common/unicode/uloc.h"
+#endif
+#endif
+
#if defined(OS_ANDROID)
#include "base/test/test_support_android.h"
#endif
@@ -321,6 +329,22 @@ void TestSuite::Initialize() {
}
base::i18n::InitializeICU();
+ // On the Mac OS X command line, the default locale is *_POSIX. In Chromium,
+ // the locale is set via an OS X locale API and is never *_POSIX.
+ // Some tests (such as those involving word break iterator) will behave
+ // differently and fail if we use *POSIX locale. Setting it to en_US here
+ // does not affect tests that explicitly overrides the locale for testing.
+ // This can be an issue on all platforms other than Windows.
+ // TODO(jshin): Should we set the locale via an OS X locale API here?
+#if !defined(OS_WIN)
+#if defined(OS_IOS)
+ base::i18n::SetICUDefaultLocale("en_US");
+#else
+ std::string default_locale(uloc_getDefault());
+ if (EndsWith(default_locale, "POSIX", false))
+ base::i18n::SetICUDefaultLocale("en_US");
+#endif
+#endif
CatchMaybeTests();
ResetCommandLine();
« no previous file with comments | « base/i18n/time_formatting_unittest.cc ('k') | build/secondary/third_party/icu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698