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

Side by Side Diff: chrome/browser/chromeos/login/users/scoped_user_manager_enabler.cc

Issue 2504513002: Make FakeChromeUserManager subclass of ChromeUserManager (Closed)
Patch Set: Re-enable tests Created 4 years, 1 month 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
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 "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" 5 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h"
6 6
7 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
7 #include "components/user_manager/user_manager.h" 8 #include "components/user_manager/user_manager.h"
8 9
9 namespace chromeos { 10 namespace chromeos {
10 11
11 ScopedUserManagerEnabler::ScopedUserManagerEnabler( 12 ScopedUserManagerEnabler::ScopedUserManagerEnabler(
12 user_manager::UserManager* user_manager) { 13 ChromeUserManager* user_manager) {
13 if (user_manager::UserManager::GetForTesting()) 14 if (user_manager::UserManager::GetForTesting())
14 user_manager::UserManager::GetForTesting()->Shutdown(); 15 user_manager::UserManager::GetForTesting()->Shutdown();
15 16
16 previous_user_manager_ = 17 previous_user_manager_ =
17 user_manager::UserManager::SetForTesting(user_manager); 18 user_manager::UserManager::SetForTesting(user_manager);
18 } 19 }
19 20
20 ScopedUserManagerEnabler::~ScopedUserManagerEnabler() { 21 ScopedUserManagerEnabler::~ScopedUserManagerEnabler() {
21 // Shutdown and destroy current UserManager instance that we track. 22 // Shutdown and destroy current UserManager instance that we track.
22 user_manager::UserManager::Get()->Shutdown(); 23 user_manager::UserManager::Get()->Shutdown();
23 delete user_manager::UserManager::Get(); 24 delete user_manager::UserManager::Get();
24 user_manager::UserManager::SetInstance(NULL); 25 user_manager::UserManager::SetInstance(NULL);
achuithb 2016/11/15 20:13:28 nullptr here
yoshiki 2016/11/16 15:50:19 Done.
25 26
26 user_manager::UserManager::SetForTesting(previous_user_manager_); 27 user_manager::UserManager::SetForTesting(previous_user_manager_);
27 } 28 }
28 29
29 } // namespace chromeos 30 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698