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

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

Issue 23449023: Add kiosk browser tests for network configuration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix flakiness Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/mock_user_manager.h" 5 #include "chrome/browser/chromeos/login/mock_user_manager.h"
6 6
7 namespace chromeos { 7 namespace chromeos {
8 8
9 MockUserManager::MockUserManager() : user_(NULL), 9 MockUserManager::MockUserManager() : user_(NULL),
10 user_flow_(new DefaultUserFlow()) {} 10 user_flow_(new DefaultUserFlow()) {}
11 11
12 MockUserManager::~MockUserManager() { 12 MockUserManager::~MockUserManager() {
13 delete user_; 13 delete user_;
14 } 14 }
15 15
16 const UserList& MockUserManager::GetUsers() const {
17 return user_list_;
18 }
19
16 const User* MockUserManager::GetLoggedInUser() const { 20 const User* MockUserManager::GetLoggedInUser() const {
17 return user_; 21 return user_;
18 } 22 }
19 23
20 User* MockUserManager::GetLoggedInUser() { 24 User* MockUserManager::GetLoggedInUser() {
21 return user_; 25 return user_;
22 } 26 }
23 27
28 const std::string& MockUserManager::GetOwnerEmail() {
29 return user_->email();
30 }
31
24 const User* MockUserManager::GetActiveUser() const { 32 const User* MockUserManager::GetActiveUser() const {
25 return user_; 33 return user_;
26 } 34 }
27 35
28 User* MockUserManager::GetActiveUser() { 36 User* MockUserManager::GetActiveUser() {
29 return user_; 37 return user_;
30 } 38 }
31 39
32 UserImageManager* MockUserManager::GetUserImageManager() { 40 UserImageManager* MockUserManager::GetUserImageManager() {
33 return user_image_manager_.get(); 41 return user_image_manager_.get();
34 } 42 }
35 43
36 // Creates a new User instance. 44 // Creates a new User instance.
37 void MockUserManager::SetActiveUser(const std::string& email) { 45 void MockUserManager::SetActiveUser(const std::string& email) {
38 delete user_; 46 delete user_;
39 user_ = User::CreateRegularUser(email); 47 user_ = User::CreateRegularUser(email);
48 user_list_.clear();
49 user_list_.push_back(user_);
40 } 50 }
41 51
42 UserFlow* MockUserManager::GetCurrentUserFlow() const { 52 UserFlow* MockUserManager::GetCurrentUserFlow() const {
43 return user_flow_.get(); 53 return user_flow_.get();
44 } 54 }
45 55
46 UserFlow* MockUserManager::GetUserFlow(const std::string&) const { 56 UserFlow* MockUserManager::GetUserFlow(const std::string&) const {
47 return user_flow_.get(); 57 return user_flow_.get();
48 } 58 }
49 59
50 User* MockUserManager::CreatePublicAccountUser(const std::string& email) { 60 User* MockUserManager::CreatePublicAccountUser(const std::string& email) {
51 delete user_; 61 delete user_;
52 user_ = User::CreatePublicAccountUser(email); 62 user_ = User::CreatePublicAccountUser(email);
63 user_list_.clear();
64 user_list_.push_back(user_);
53 return user_; 65 return user_;
54 } 66 }
55 67
56 } // namespace chromeos 68 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/mock_user_manager.h ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698