forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Locales should be restored after tests and scoping should be used. Added restores and one restore changed to scoped version. Review URL: https://codereview.chromium.org/1162603004 Cr-Commit-Position: refs/heads/master@{#344453}
- Loading branch information
olli.raula
authored and
Commit bot
committed
Aug 20, 2015
1 parent
860101c
commit 3be75bf
Showing
9 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// 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. | ||
|
||
#include "base/test/icu_test_util.h" | ||
|
||
#include "base/i18n/rtl.h" | ||
#include "third_party/icu/source/common/unicode/uloc.h" | ||
|
||
namespace base { | ||
namespace test { | ||
|
||
ScopedRestoreICUDefaultLocale::ScopedRestoreICUDefaultLocale() | ||
: default_locale_(uloc_getDefault()) {} | ||
|
||
ScopedRestoreICUDefaultLocale::~ScopedRestoreICUDefaultLocale() { | ||
i18n::SetICUDefaultLocale(default_locale_.data()); | ||
} | ||
|
||
} // namespace test | ||
} // namespace base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 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 BASE_ICU_TEST_UTIL_H_ | ||
#define BASE_ICU_TEST_UTIL_H_ | ||
|
||
#include <string> | ||
|
||
#include "base/macros.h" | ||
|
||
namespace base { | ||
namespace test { | ||
|
||
class ScopedRestoreICUDefaultLocale { | ||
public: | ||
ScopedRestoreICUDefaultLocale(); | ||
~ScopedRestoreICUDefaultLocale(); | ||
|
||
private: | ||
std::string default_locale_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(ScopedRestoreICUDefaultLocale); | ||
}; | ||
|
||
} // namespace test | ||
} // namespace base | ||
|
||
#endif // BASE_ICU_TEST_UTIL_H_ |