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

Side by Side Diff: chrome/browser/chromeos/login/ui/user_adding_screen_browsertest.cc

Issue 445353004: GetProfileByUser deprecated and renamed to GetProfileByUserUnsafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 4 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 | Annotate | Revision Log
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 "ash/session/session_state_delegate.h" 5 #include "ash/session/session_state_delegate.h"
6 #include "ash/shell.h" 6 #include "ash/shell.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/chrome_notification_types.h" 8 #include "chrome/browser/chrome_notification_types.h"
9 #include "chrome/browser/chromeos/login/lock/screen_locker.h" 9 #include "chrome/browser/chromeos/login/lock/screen_locker.h"
10 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h" 10 #include "chrome/browser/chromeos/login/lock/screen_locker_tester.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ASSERT_EQ(unsigned(i + 1), user_manager->GetLoggedInUsers().size()); 159 ASSERT_EQ(unsigned(i + 1), user_manager->GetLoggedInUsers().size());
160 } 160 }
161 161
162 EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE, 162 EXPECT_EQ(ash::SessionStateDelegate::SESSION_STATE_ACTIVE,
163 ash::Shell::GetInstance()->session_state_delegate()-> 163 ash::Shell::GetInstance()->session_state_delegate()->
164 GetSessionState()); 164 GetSessionState());
165 165
166 // Now check how unlock policy works for these users. 166 // Now check how unlock policy works for these users.
167 PrefService* prefs1 = 167 PrefService* prefs1 =
168 ProfileHelper::Get() 168 ProfileHelper::Get()
169 ->GetProfileByUser(user_manager->GetLoggedInUsers()[0]) 169 ->GetProfileByUserUnsafe(user_manager->GetLoggedInUsers()[0])
170 ->GetPrefs(); 170 ->GetPrefs();
171 PrefService* prefs2 = 171 PrefService* prefs2 =
172 ProfileHelper::Get() 172 ProfileHelper::Get()
173 ->GetProfileByUser(user_manager->GetLoggedInUsers()[1]) 173 ->GetProfileByUserUnsafe(user_manager->GetLoggedInUsers()[1])
174 ->GetPrefs(); 174 ->GetPrefs();
175 PrefService* prefs3 = 175 PrefService* prefs3 =
176 ProfileHelper::Get() 176 ProfileHelper::Get()
177 ->GetProfileByUser(user_manager->GetLoggedInUsers()[2]) 177 ->GetProfileByUserUnsafe(user_manager->GetLoggedInUsers()[2])
178 ->GetPrefs(); 178 ->GetPrefs();
179 ASSERT_TRUE(prefs1 != NULL); 179 ASSERT_TRUE(prefs1 != NULL);
180 ASSERT_TRUE(prefs2 != NULL); 180 ASSERT_TRUE(prefs2 != NULL);
181 ASSERT_TRUE(prefs3 != NULL); 181 ASSERT_TRUE(prefs3 != NULL);
182 prefs1->SetBoolean(prefs::kEnableAutoScreenLock, false); 182 prefs1->SetBoolean(prefs::kEnableAutoScreenLock, false);
183 prefs2->SetBoolean(prefs::kEnableAutoScreenLock, false); 183 prefs2->SetBoolean(prefs::kEnableAutoScreenLock, false);
184 prefs3->SetBoolean(prefs::kEnableAutoScreenLock, false); 184 prefs3->SetBoolean(prefs::kEnableAutoScreenLock, false);
185 185
186 // One of the users has the primary-only policy. 186 // One of the users has the primary-only policy.
187 // List of unlock users doesn't depend on kEnableLockScreen preference. 187 // List of unlock users doesn't depend on kEnableLockScreen preference.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 content::NotificationService::AllSources()).Wait(); 263 content::NotificationService::AllSources()).Wait();
264 264
265 UserAddingScreen::Get()->Start(); 265 UserAddingScreen::Get()->Start();
266 content::RunAllPendingInMessageLoop(); 266 content::RunAllPendingInMessageLoop();
267 CheckScreenIsVisible(); 267 CheckScreenIsVisible();
268 UserAddingScreen::Get()->Cancel(); 268 UserAddingScreen::Get()->Cancel();
269 content::RunAllPendingInMessageLoop(); 269 content::RunAllPendingInMessageLoop();
270 } 270 }
271 271
272 } // namespace chromeos 272 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698