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

Unified Diff: chrome/browser/net/client_hints_unittest.cc

Issue 24809002: Leaking locale changes is a Very Bad Idea. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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: chrome/browser/net/client_hints_unittest.cc
diff --git a/chrome/browser/net/client_hints_unittest.cc b/chrome/browser/net/client_hints_unittest.cc
index c93b3b66d50597303c6e400758d25d4bada777d3..828db69854b8eb3690b62aafd3be5edacd9d1a29 100644
--- a/chrome/browser/net/client_hints_unittest.cc
+++ b/chrome/browser/net/client_hints_unittest.cc
@@ -4,9 +4,8 @@
#include "chrome/browser/net/client_hints.h"
-#include <locale.h>
-
#include "base/logging.h"
+#include "base/test/scoped_locale.h"
#include "testing/gtest/include/gtest/gtest.h"
class ClientHintsTest : public testing::Test {
@@ -26,7 +25,7 @@ TEST_F(ClientHintsTest, HintsWellFormatted) {
}
TEST_F(ClientHintsTest, HintsWellFormattedWithNonEnLocale) {
- setlocale(LC_ALL, "fr_FR.UTF-8");
+ base::ScopedLocale locale("fr_FR.UTF-8");
UpdateScreenInfo(1.567f);
std::string hint = client_hints_.GetDevicePixelRatioHeader();
EXPECT_EQ("1.57", hint);
« 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