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

Side by Side Diff: chrome/browser/ui/ash/session_state_delegate_chromeos_unittest.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 years, 3 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
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/ui/ash/session_state_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // We must ensure that the PolicyCertVerifier outlives the 74 // We must ensure that the PolicyCertVerifier outlives the
75 // PolicyCertService so shutdown the profile here. Additionally, we need 75 // PolicyCertService so shutdown the profile here. Additionally, we need
76 // to run the message loop between freeing the PolicyCertService and 76 // to run the message loop between freeing the PolicyCertService and
77 // freeing the PolicyCertVerifier (see 77 // freeing the PolicyCertVerifier (see
78 // PolicyCertService::OnTrustAnchorsChanged() which is called from 78 // PolicyCertService::OnTrustAnchorsChanged() which is called from
79 // PolicyCertService::Shutdown()). 79 // PolicyCertService::Shutdown()).
80 base::RunLoop().RunUntilIdle(); 80 base::RunLoop().RunUntilIdle();
81 } 81 }
82 82
83 // Add and log in a user to the session. 83 // Add and log in a user to the session.
84 void UserAddedToSession(std::string user) { 84 void UserAddedToSession(const std::string& user) {
85 user_manager()->AddUser(user); 85 user_manager()->AddUser(user);
86 user_manager()->LoginUser(user); 86 user_manager()->LoginUser(user);
87 } 87 }
88 88
89 // Get the active user. 89 // Get the active user.
90 const std::string& GetActiveUser() { 90 const std::string& GetActiveUser() {
91 return user_manager::UserManager::Get()->GetActiveUser()->email(); 91 return user_manager::UserManager::Get()->GetActiveUser()->email();
92 } 92 }
93 93
94 FakeChromeUserManager* user_manager() { return user_manager_; } 94 FakeChromeUserManager* user_manager() { return user_manager_; }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 prefs::kMultiProfileUserBehavior, 283 prefs::kMultiProfileUserBehavior,
284 chromeos::MultiProfileUserController::kBehaviorNotAllowed); 284 chromeos::MultiProfileUserController::kBehaviorNotAllowed);
285 user_manager()->AddUser("bb@b.b"); 285 user_manager()->AddUser("bb@b.b");
286 EXPECT_FALSE( 286 EXPECT_FALSE(
287 session_state_delegate()->CanAddUserToMultiProfile(&add_user_error)); 287 session_state_delegate()->CanAddUserToMultiProfile(&add_user_error));
288 EXPECT_EQ(ash::SessionStateDelegate::ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER, 288 EXPECT_EQ(ash::SessionStateDelegate::ADD_USER_ERROR_NOT_ALLOWED_PRIMARY_USER,
289 add_user_error); 289 add_user_error);
290 } 290 }
291 291
292 } // namespace chromeos 292 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698