| 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 <sys/types.h> | 5 #include <sys/types.h> |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" | 12 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h" |
| 13 #include "chrome/browser/chromeos/login/login_manager_test.h" | 13 #include "chrome/browser/chromeos/login/login_manager_test.h" |
| 14 #include "chrome/browser/chromeos/login/startup_utils.h" | 14 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 15 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 15 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 16 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 17 #include "chrome/browser/chromeos/preferences.h" | 16 #include "chrome/browser/chromeos/preferences.h" |
| 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 17 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 19 #include "chrome/browser/chromeos/settings/cros_settings.h" | 18 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 20 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" | 19 #include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h" |
| 21 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" | 20 #include "chrome/browser/chromeos/system/fake_input_device_settings.h" |
| 22 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" | 21 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" |
| 23 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 24 #include "chromeos/chromeos_switches.h" | 23 #include "chromeos/chromeos_switches.h" |
| 25 #include "chromeos/ime/fake_ime_keyboard.h" | 24 #include "chromeos/ime/fake_ime_keyboard.h" |
| 26 #include "components/feedback/tracing_manager.h" | 25 #include "components/feedback/tracing_manager.h" |
| 26 #include "components/user_manager/user_manager.h" |
| 27 #include "content/public/test/test_utils.h" | 27 #include "content/public/test/test_utils.h" |
| 28 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
| 29 #include "ui/events/event_utils.h" | 29 #include "ui/events/event_utils.h" |
| 30 | 30 |
| 31 namespace chromeos { | 31 namespace chromeos { |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 | 34 |
| 35 const char* kTestUsers[] = {"test-user1@gmail.com", "test-user2@gmail.com"}; | 35 const char* kTestUsers[] = {"test-user1@gmail.com", "test-user2@gmail.com"}; |
| 36 | 36 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 DISALLOW_COPY_AND_ASSIGN(PreferencesTest); | 132 DISALLOW_COPY_AND_ASSIGN(PreferencesTest); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 IN_PROC_BROWSER_TEST_F(PreferencesTest, PRE_MultiProfiles) { | 135 IN_PROC_BROWSER_TEST_F(PreferencesTest, PRE_MultiProfiles) { |
| 136 RegisterUser(kTestUsers[0]); | 136 RegisterUser(kTestUsers[0]); |
| 137 RegisterUser(kTestUsers[1]); | 137 RegisterUser(kTestUsers[1]); |
| 138 chromeos::StartupUtils::MarkOobeCompleted(); | 138 chromeos::StartupUtils::MarkOobeCompleted(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 IN_PROC_BROWSER_TEST_F(PreferencesTest, MultiProfiles) { | 141 IN_PROC_BROWSER_TEST_F(PreferencesTest, MultiProfiles) { |
| 142 UserManager* user_manager = UserManager::Get(); | 142 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 143 | 143 |
| 144 // Add first user and init its preferences. Check that corresponding | 144 // Add first user and init its preferences. Check that corresponding |
| 145 // settings has been changed. | 145 // settings has been changed. |
| 146 LoginUser(kTestUsers[0]); | 146 LoginUser(kTestUsers[0]); |
| 147 const user_manager::User* user1 = user_manager->FindUser(kTestUsers[0]); | 147 const user_manager::User* user1 = user_manager->FindUser(kTestUsers[0]); |
| 148 PrefService* prefs1 = | 148 PrefService* prefs1 = |
| 149 ProfileHelper::Get()->GetProfileByUser(user1)->GetPrefs(); | 149 ProfileHelper::Get()->GetProfileByUser(user1)->GetPrefs(); |
| 150 SetPrefs(prefs1, false); | 150 SetPrefs(prefs1, false); |
| 151 content::RunAllPendingInMessageLoop(); | 151 content::RunAllPendingInMessageLoop(); |
| 152 CheckSettingsCorrespondToPrefs(prefs1); | 152 CheckSettingsCorrespondToPrefs(prefs1); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 !prefs1->GetBoolean(prefs::kTapToClickEnabled)); | 199 !prefs1->GetBoolean(prefs::kTapToClickEnabled)); |
| 200 CheckLocalStateCorrespondsToPrefs(prefs1); | 200 CheckLocalStateCorrespondsToPrefs(prefs1); |
| 201 | 201 |
| 202 // Switch user back. | 202 // Switch user back. |
| 203 user_manager->SwitchActiveUser(kTestUsers[0]); | 203 user_manager->SwitchActiveUser(kTestUsers[0]); |
| 204 CheckSettingsCorrespondToPrefs(prefs1); | 204 CheckSettingsCorrespondToPrefs(prefs1); |
| 205 CheckLocalStateCorrespondsToPrefs(prefs1); | 205 CheckLocalStateCorrespondsToPrefs(prefs1); |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace chromeos | 208 } // namespace chromeos |
| OLD | NEW |