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

Unified Diff: base/i18n/case_conversion_unittest.cc

Issue 1162603004: Restore locales after tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added spaces Created 5 years, 4 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/base.gyp ('k') | base/i18n/number_formatting_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/case_conversion_unittest.cc
diff --git a/base/i18n/case_conversion_unittest.cc b/base/i18n/case_conversion_unittest.cc
index dc5bc1fe8b145d8080f593221051f3fc9a1628ff..ee795bc6e334c89f18f6276fa269c199e25fe95a 100644
--- a/base/i18n/case_conversion_unittest.cc
+++ b/base/i18n/case_conversion_unittest.cc
@@ -5,6 +5,7 @@
#include "base/i18n/case_conversion.h"
#include "base/i18n/rtl.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/test/icu_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/icu/source/i18n/unicode/usearch.h"
@@ -58,7 +59,7 @@ TEST(CaseConversionTest, TurkishLocaleConversion) {
const string16 expected_lower(WideToUTF16(L"\x69\x131"));
const string16 expected_upper(WideToUTF16(L"\x49\x49"));
- std::string default_locale(uloc_getDefault());
+ test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_US");
string16 result = ToLower(mixed);
@@ -77,8 +78,6 @@ TEST(CaseConversionTest, TurkishLocaleConversion) {
result = ToUpper(mixed);
EXPECT_EQ(expected_upper_turkish, result);
-
- SetICUDefaultLocale(default_locale.data());
}
TEST(CaseConversionTest, FoldCase) {
@@ -97,7 +96,7 @@ TEST(CaseConversionTest, FoldCase) {
const string16 turkish(WideToUTF16(L"\x49\x131"));
const string16 turkish_expected(WideToUTF16(L"\x69\x131"));
- std::string default_locale(uloc_getDefault());
+ test::ScopedRestoreICUDefaultLocale restore_locale;
i18n::SetICUDefaultLocale("en_US");
EXPECT_EQ(turkish_expected, FoldCase(turkish));
« no previous file with comments | « base/base.gyp ('k') | base/i18n/number_formatting_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698