| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/preferences.h" | 5 #include "chrome/browser/chromeos/preferences.h" |
| 6 | 6 |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/prefs/pref_member.h" | 8 #include "base/prefs/pref_member.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 11 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" | 11 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" |
| 12 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" | 12 #include "chrome/browser/chromeos/input_method/mock_input_method_manager.h" |
| 13 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 13 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 14 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" | 14 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
| 15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
| 16 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" | 16 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" |
| 17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/test/base/testing_browser_process.h" | 19 #include "chrome/test/base/testing_browser_process.h" |
| 20 #include "chrome/test/base/testing_pref_service_syncable.h" | 20 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 21 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
| 22 #include "chrome/test/base/testing_profile_manager.h" | 22 #include "chrome/test/base/testing_profile_manager.h" |
| 23 #include "content/public/test/test_browser_thread_bundle.h" | 23 #include "content/public/test/test_browser_thread_bundle.h" |
| 24 #include "content/public/test/test_utils.h" | 24 #include "content/public/test/test_utils.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 class PreferencesTest : public testing::Test { | 142 class PreferencesTest : public testing::Test { |
| 143 public: | 143 public: |
| 144 PreferencesTest() {} | 144 PreferencesTest() {} |
| 145 ~PreferencesTest() override {} | 145 ~PreferencesTest() override {} |
| 146 | 146 |
| 147 void SetUp() override { | 147 void SetUp() override { |
| 148 profile_manager_.reset( | 148 profile_manager_.reset( |
| 149 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 149 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
| 150 ASSERT_TRUE(profile_manager_->SetUp()); | 150 ASSERT_TRUE(profile_manager_->SetUp()); |
| 151 | 151 |
| 152 chromeos::FakeUserManager* user_manager = new chromeos::FakeUserManager(); | 152 chromeos::FakeChromeUserManager* user_manager = |
| 153 new chromeos::FakeChromeUserManager(); |
| 153 user_manager_enabler_.reset( | 154 user_manager_enabler_.reset( |
| 154 new chromeos::ScopedUserManagerEnabler(user_manager)); | 155 new chromeos::ScopedUserManagerEnabler(user_manager)); |
| 155 | 156 |
| 156 const char test_user_email[] = "test_user@example.com"; | 157 const char test_user_email[] = "test_user@example.com"; |
| 157 test_user_ = user_manager->AddUser(test_user_email); | 158 test_user_ = user_manager->AddUser(test_user_email); |
| 158 user_manager->LoginUser(test_user_email); | 159 user_manager->LoginUser(test_user_email); |
| 159 user_manager->SwitchActiveUser(test_user_email); | 160 user_manager->SwitchActiveUser(test_user_email); |
| 160 | 161 |
| 161 test_profile_ = profile_manager_->CreateTestingProfile( | 162 test_profile_ = profile_manager_->CreateTestingProfile( |
| 162 chrome::kInitialProfile); | 163 chrome::kInitialProfile); |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 "Syncable values should have added local values on initialization."); | 698 "Syncable values should have added local values on initialization."); |
| 698 ExpectGlobalValues( | 699 ExpectGlobalValues( |
| 699 "es,en-US", | 700 "es,en-US", |
| 700 "xkb:es::spa,xkb:us::eng,xkb:ru::rus,xkb:xy::xyz," + | 701 "xkb:es::spa,xkb:us::eng,xkb:ru::rus,xkb:xy::xyz," + |
| 701 ToInputMethodIds("xkb:jp::jpn"), | 702 ToInputMethodIds("xkb:jp::jpn"), |
| 702 std::string(kIdentityIMEID) + "," + kUnknownIMEID); | 703 std::string(kIdentityIMEID) + "," + kUnknownIMEID); |
| 703 } | 704 } |
| 704 } | 705 } |
| 705 | 706 |
| 706 } // namespace chromeos | 707 } // namespace chromeos |
| OLD | NEW |