Avoid adding English to the blocked languages on non-English UI (Recommit)
Because of crbug/36182, English is translated even though English exists in the Accept language list on non-English loccale. English is always listed in the list by default whichever the user locale is. So, when the blocked language list is created, English should not be included in the list on non-English locale.
This is essentially the same change as r218477 (https://codereview.chromium.org/23013007/). As that CL was reverted (https://codereview.chromium.org/23126007/) maybe because changing locales affected the other tests, I'll recommit this with scoped locale modifications.
BUG=264155
TEST=unit_tests
Review URL: https://chromiumcodereview.appspot.com/23195005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218950 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index b16dc3b..4ccc3c1 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -80,6 +80,7 @@
#include "chrome/common/extensions/value_builder.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "chrome/test/base/scoped_browser_locale.h"
#include "chrome/test/base/testing_profile.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/dom_storage_context.h"
@@ -4677,23 +4678,6 @@
EXPECT_EQ(0u, loaded_.size());
}
-namespace {
- class ScopedBrowserLocale {
- public:
- explicit ScopedBrowserLocale(const std::string& new_locale)
- : old_locale_(g_browser_process->GetApplicationLocale()) {
- g_browser_process->SetApplicationLocale(new_locale);
- }
-
- ~ScopedBrowserLocale() {
- g_browser_process->SetApplicationLocale(old_locale_);
- }
-
- private:
- std::string old_locale_;
- };
-} // namespace
-
TEST_F(ExtensionServiceTest, ExternalPrefProvider) {
InitializeEmptyExtensionService();