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

Side by Side Diff: chrome/browser/chromeos/login/fake_login_utils.cc

Issue 110913009: ChromeOS: properly enable multiprofile mode in LoginManagerTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes Created 7 years 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_manager_test.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/fake_login_utils.h" 5 #include "chrome/browser/chromeos/login/fake_login_utils.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 UserManager::Get()->SessionStarted(); 54 UserManager::Get()->SessionStarted();
55 } 55 }
56 56
57 void FakeLoginUtils::PrepareProfile(const UserContext& user_context, 57 void FakeLoginUtils::PrepareProfile(const UserContext& user_context,
58 const std::string& display_email, 58 const std::string& display_email,
59 bool has_cookies, 59 bool has_cookies,
60 bool has_active_session, 60 bool has_active_session,
61 LoginUtils::Delegate* delegate) { 61 LoginUtils::Delegate* delegate) {
62 UserManager::Get()->UserLoggedIn( 62 UserManager::Get()->UserLoggedIn(
63 user_context.username, user_context.username_hash, false); 63 user_context.username, user_context.username_hash, false);
64 Profile* profile; 64 Profile* profile = CreateProfile(user_context.username);
65 if (should_launch_browser_) {
66 profile = CreateProfile(user_context.username);
67 } else {
68 TestingProfile* testing_profile = new TestingProfile();
69 testing_profile->set_profile_name(user_context.username);
70
71 profile = testing_profile;
72 g_browser_process->profile_manager()->
73 RegisterTestingProfile(profile, false, false);
74 }
75 65
76 if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { 66 if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) {
77 User* active_user = UserManager::Get()->GetActiveUser(); 67 User* active_user = UserManager::Get()->GetActiveUser();
78 std::string managed_user_sync_id = 68 std::string managed_user_sync_id =
79 UserManager::Get()->GetSupervisedUserManager()-> 69 UserManager::Get()->GetSupervisedUserManager()->
80 GetUserSyncId(active_user->email()); 70 GetUserSyncId(active_user->email());
81 if (managed_user_sync_id.empty()) 71 if (managed_user_sync_id.empty())
82 managed_user_sync_id = "DUMMY ID"; 72 managed_user_sync_id = "DUMMY ID";
83 profile->GetPrefs()->SetString(prefs::kManagedUserId, 73 profile->GetPrefs()->SetString(prefs::kManagedUserId,
84 managed_user_sync_id); 74 managed_user_sync_id);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 const std::string& password) { 121 const std::string& password) {
132 expected_username_ = username; 122 expected_username_ = username;
133 expected_password_ = password; 123 expected_password_ = password;
134 if (authenticator_.get()) { 124 if (authenticator_.get()) {
135 static_cast<MockAuthenticator*>(authenticator_.get())-> 125 static_cast<MockAuthenticator*>(authenticator_.get())->
136 SetExpectedCredentials(username, password); 126 SetExpectedCredentials(username, password);
137 } 127 }
138 } 128 }
139 129
140 } // namespace chromeos 130 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698