Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1306)

Side by Side Diff: chrome/browser/chromeos/preferences_chromeos_browsertest.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/chromeos/preferences_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences.h ('k') | chrome/browser/chromeos/preferences_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698