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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/prefs/pref_service.h" | 6 #include "base/prefs/pref_service.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/task_runner.h" | 8 #include "base/task_runner.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 const std::string& expected_locale, | 218 const std::string& expected_locale, |
219 const std::string& expected_keyboard_layout, | 219 const std::string& expected_keyboard_layout, |
220 const std::string& expected_keyboard_select_control) { | 220 const std::string& expected_keyboard_select_control) { |
221 statistics_provider_->set_locale(initial_locale); | 221 statistics_provider_->set_locale(initial_locale); |
222 statistics_provider_->set_keyboard_layout(keyboard_layout); | 222 statistics_provider_->set_keyboard_layout(keyboard_layout); |
223 | 223 |
224 // Initialize StartupCustomizationDocument with fake statistics provider. | 224 // Initialize StartupCustomizationDocument with fake statistics provider. |
225 StartupCustomizationDocument::GetInstance()->Init( | 225 StartupCustomizationDocument::GetInstance()->Init( |
226 statistics_provider_.get()); | 226 statistics_provider_.get()); |
227 | 227 |
| 228 g_browser_process->local_state()->SetString( |
| 229 prefs::kHardwareKeyboardLayout, keyboard_layout); |
| 230 |
228 input_method::InputMethodManager::Get() | 231 input_method::InputMethodManager::Get() |
229 ->GetInputMethodUtil() | 232 ->GetInputMethodUtil() |
230 ->InitXkbInputMethodsForTesting(); | 233 ->InitXkbInputMethodsForTesting(); |
231 | 234 |
232 std::string expected_keyboard_select = expected_keyboard_select_control; | 235 std::string expected_keyboard_select = expected_keyboard_select_control; |
233 if (extension_ime_util::UseWrappedExtensionKeyboardLayouts()) { | 236 if (extension_ime_util::UseWrappedExtensionKeyboardLayouts()) { |
234 // Modifies the expected keyboard select control options for the new | 237 // Modifies the expected keyboard select control options for the new |
235 // extension based xkb id. | 238 // extension based xkb id. |
236 size_t pos = 0; | 239 size_t pos = 0; |
237 std::string repl_old = "xkb:"; | 240 std::string repl_old = "xkb:"; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 RunLocalizationTest("es,en-US,nl", "xkb:be::nld", | 329 RunLocalizationTest("es,en-US,nl", "xkb:be::nld", |
327 "es,en-US,nl", "xkb:be::nld", | 330 "es,en-US,nl", "xkb:be::nld", |
328 "xkb:be::nld,[xkb:es::spa,xkb:latam::spa,xkb:us::eng]"); | 331 "xkb:be::nld,[xkb:es::spa,xkb:latam::spa,xkb:us::eng]"); |
329 | 332 |
330 RunLocalizationTest("ru,de", "xkb:ru::rus", | 333 RunLocalizationTest("ru,de", "xkb:ru::rus", |
331 "ru,de", kUSLayout, | 334 "ru,de", kUSLayout, |
332 "xkb:us::eng"); | 335 "xkb:us::eng"); |
333 } | 336 } |
334 | 337 |
335 } // namespace chromeos | 338 } // namespace chromeos |
OLD | NEW |