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

Unified Diff: base/i18n/icu_test_util.h

Issue 1162603004: Restore locales after tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing file 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/i18n/case_conversion_unittest.cc ('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/icu_test_util.h
diff --git a/base/i18n/icu_test_util.h b/base/i18n/icu_test_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..b3ce0a75b7b55bf8604371fd7b7ee8f91ee71765
--- /dev/null
+++ b/base/i18n/icu_test_util.h
@@ -0,0 +1,28 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ICU_TEST_UTIL_H_
Mark Mentovai 2015/08/18 14:40:07 Full paths: BASE_ICU_TEST_UTIL_H_.
+#define ICU_TEST_UTIL_H_
+
+#include "base/i18n/rtl.h"
+
+namespace base {
+namespace i18n {
+
+class ScopedSetICUDefaultLocale {
+ std::string default_locale;
Mark Mentovai 2015/08/18 14:40:07 Please follow the style guide: public: before priv
+
+ public:
+ScopedSetICUDefaultLocale(std::string locale)
Mark Mentovai 2015/08/18 14:40:07 Use proper indentation per the style guide.
Mark Mentovai 2015/08/18 14:40:07 Since every caller passes uloc_getDefault(), the c
+ : default_locale(locale) {}
Mark Mentovai 2015/08/18 14:40:07 You should split this up into a .h and a .cc. They
+
+~ScopedSetICUDefaultLocale() {
+ i18n::SetICUDefaultLocale(default_locale.data());
+}
+};
+
+
+} // namespace i18n
+} // namespace base
+#endif
Mark Mentovai 2015/08/18 14:40:07 Blank line before, and make this #endif // BASE_
« no previous file with comments | « base/i18n/case_conversion_unittest.cc ('k') | base/i18n/number_formatting_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698