OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
10 #include "chrome/browser/chromeos/base/locale_util.h" | 10 #include "chrome/browser/chromeos/base/locale_util.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 }; | 176 }; |
177 | 177 |
178 } // anonymous namespace | 178 } // anonymous namespace |
179 | 179 |
180 typedef InProcessBrowserTest CustomizationLocaleTest; | 180 typedef InProcessBrowserTest CustomizationLocaleTest; |
181 | 181 |
182 IN_PROC_BROWSER_TEST_F(CustomizationLocaleTest, CheckAvailableLocales) { | 182 IN_PROC_BROWSER_TEST_F(CustomizationLocaleTest, CheckAvailableLocales) { |
183 for (size_t i = 0; i < languages_available.size(); ++i) { | 183 for (size_t i = 0; i < languages_available.size(); ++i) { |
184 LanguageSwitchedWaiter waiter(base::Bind(&VerifyLanguageSwitched)); | 184 LanguageSwitchedWaiter waiter(base::Bind(&VerifyLanguageSwitched)); |
185 locale_util::SwitchLanguage(languages_available[i], true, true, | 185 locale_util::SwitchLanguage(languages_available[i], true, true, |
186 waiter.Callback()); | 186 waiter.Callback(), |
| 187 ProfileManager::GetActiveUserProfile()); |
187 waiter.Wait(); | 188 waiter.Wait(); |
188 { | 189 { |
189 std::string resolved_locale; | 190 std::string resolved_locale; |
190 base::ThreadRestrictions::ScopedAllowIO allow_io; | 191 base::ThreadRestrictions::ScopedAllowIO allow_io; |
191 l10n_util::CheckAndResolveLocale(languages_available[i], | 192 l10n_util::CheckAndResolveLocale(languages_available[i], |
192 &resolved_locale); | 193 &resolved_locale); |
193 EXPECT_EQ(GetExpectedLanguage(languages_available[i]), resolved_locale) | 194 EXPECT_EQ(GetExpectedLanguage(languages_available[i]), resolved_locale) |
194 << "CheckAndResolveLocale() failed for language='" | 195 << "CheckAndResolveLocale() failed for language='" |
195 << languages_available[i] << "'"; | 196 << languages_available[i] << "'"; |
196 } | 197 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 break; | 247 break; |
247 } | 248 } |
248 } | 249 } |
249 } | 250 } |
250 | 251 |
251 INSTANTIATE_TEST_CASE_P(StringSequence, | 252 INSTANTIATE_TEST_CASE_P(StringSequence, |
252 CustomizationVPDTest, | 253 CustomizationVPDTest, |
253 testing::ValuesIn(kVPDInitialLocales)); | 254 testing::ValuesIn(kVPDInitialLocales)); |
254 | 255 |
255 } // namespace chromeos | 256 } // namespace chromeos |
OLD | NEW |