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 <stddef.h> | 5 #include <stddef.h> |
6 #include <sys/types.h> | 6 #include <sys/types.h> |
7 | 7 |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 PrefService* prefs2 = | 171 PrefService* prefs2 = |
172 ProfileHelper::Get()->GetProfileByUserUnsafe(user2)->GetPrefs(); | 172 ProfileHelper::Get()->GetProfileByUserUnsafe(user2)->GetPrefs(); |
173 SetPrefs(prefs2, true); | 173 SetPrefs(prefs2, true); |
174 | 174 |
175 // Check that settings were changed accordingly. | 175 // Check that settings were changed accordingly. |
176 EXPECT_TRUE(user2->is_active()); | 176 EXPECT_TRUE(user2->is_active()); |
177 CheckSettingsCorrespondToPrefs(prefs2); | 177 CheckSettingsCorrespondToPrefs(prefs2); |
178 | 178 |
179 // Check that changing prefs of the active user doesn't affect prefs of the | 179 // Check that changing prefs of the active user doesn't affect prefs of the |
180 // inactive user. | 180 // inactive user. |
181 scoped_ptr<base::DictionaryValue> prefs_backup = | 181 std::unique_ptr<base::DictionaryValue> prefs_backup = |
182 prefs1->GetPreferenceValues(); | 182 prefs1->GetPreferenceValues(); |
183 SetPrefs(prefs2, false); | 183 SetPrefs(prefs2, false); |
184 CheckSettingsCorrespondToPrefs(prefs2); | 184 CheckSettingsCorrespondToPrefs(prefs2); |
185 EXPECT_TRUE(prefs_backup->Equals(prefs1->GetPreferenceValues().get())); | 185 EXPECT_TRUE(prefs_backup->Equals(prefs1->GetPreferenceValues().get())); |
186 SetPrefs(prefs2, true); | 186 SetPrefs(prefs2, true); |
187 CheckSettingsCorrespondToPrefs(prefs2); | 187 CheckSettingsCorrespondToPrefs(prefs2); |
188 EXPECT_TRUE(prefs_backup->Equals(prefs1->GetPreferenceValues().get())); | 188 EXPECT_TRUE(prefs_backup->Equals(prefs1->GetPreferenceValues().get())); |
189 | 189 |
190 // Check that changing prefs of the inactive user doesn't affect prefs of the | 190 // Check that changing prefs of the inactive user doesn't affect prefs of the |
191 // active user. | 191 // active user. |
(...skipping 16 matching lines...) Expand all Loading... |
208 !prefs1->GetBoolean(prefs::kTapToClickEnabled)); | 208 !prefs1->GetBoolean(prefs::kTapToClickEnabled)); |
209 CheckLocalStateCorrespondsToPrefs(prefs1); | 209 CheckLocalStateCorrespondsToPrefs(prefs1); |
210 | 210 |
211 // Switch user back. | 211 // Switch user back. |
212 user_manager->SwitchActiveUser(test_users_[0]); | 212 user_manager->SwitchActiveUser(test_users_[0]); |
213 CheckSettingsCorrespondToPrefs(prefs1); | 213 CheckSettingsCorrespondToPrefs(prefs1); |
214 CheckLocalStateCorrespondsToPrefs(prefs1); | 214 CheckLocalStateCorrespondsToPrefs(prefs1); |
215 } | 215 } |
216 | 216 |
217 } // namespace chromeos | 217 } // namespace chromeos |
OLD | NEW |