OLD | NEW |
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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 MOCK_METHOD1(StartLocallyManagedUserCreationTransaction, | 88 MOCK_METHOD1(StartLocallyManagedUserCreationTransaction, |
89 void(const string16&)); | 89 void(const string16&)); |
90 MOCK_METHOD1(SetLocallyManagedUserCreationTransactionUserId, | 90 MOCK_METHOD1(SetLocallyManagedUserCreationTransactionUserId, |
91 void(const std::string&)); | 91 void(const std::string&)); |
92 MOCK_METHOD0(CommitLocallyManagedUserCreationTransaction, void(void)); | 92 MOCK_METHOD0(CommitLocallyManagedUserCreationTransaction, void(void)); |
93 | 93 |
94 MOCK_METHOD2(GetAppModeChromeClientOAuthInfo, bool(std::string*, | 94 MOCK_METHOD2(GetAppModeChromeClientOAuthInfo, bool(std::string*, |
95 std::string*)); | 95 std::string*)); |
96 MOCK_METHOD2(SetAppModeChromeClientOAuthInfo, void(const std::string&, | 96 MOCK_METHOD2(SetAppModeChromeClientOAuthInfo, void(const std::string&, |
97 const std::string&)); | 97 const std::string&)); |
| 98 MOCK_CONST_METHOD0(AreLocallyManagedUsersAllowed, bool(void)); |
98 | 99 |
99 // You can't mock these functions easily because nobody can create | 100 // You can't mock these functions easily because nobody can create |
100 // User objects but the UserManagerImpl and us. | 101 // User objects but the UserManagerImpl and us. |
101 virtual const User* GetLoggedInUser() const OVERRIDE; | 102 virtual const User* GetLoggedInUser() const OVERRIDE; |
102 virtual User* GetLoggedInUser() OVERRIDE; | 103 virtual User* GetLoggedInUser() OVERRIDE; |
103 virtual const User* GetActiveUser() const OVERRIDE; | 104 virtual const User* GetActiveUser() const OVERRIDE; |
104 virtual User* GetActiveUser() OVERRIDE; | 105 virtual User* GetActiveUser() OVERRIDE; |
105 | 106 |
106 virtual UserImageManager* GetUserImageManager() OVERRIDE; | 107 virtual UserImageManager* GetUserImageManager() OVERRIDE; |
107 | 108 |
108 virtual UserFlow* GetCurrentUserFlow() const OVERRIDE; | 109 virtual UserFlow* GetCurrentUserFlow() const OVERRIDE; |
109 virtual UserFlow* GetUserFlow(const std::string&) const OVERRIDE; | 110 virtual UserFlow* GetUserFlow(const std::string&) const OVERRIDE; |
110 | 111 |
111 // Sets a new User instance. | 112 // Sets a new User instance. |
112 void SetActiveUser(const std::string& email); | 113 void SetActiveUser(const std::string& email); |
113 | 114 |
114 // Creates a new public session user. Users previously created by this | 115 // Creates a new public session user. Users previously created by this |
115 // MockUserManager become invalid. | 116 // MockUserManager become invalid. |
116 User* CreatePublicAccountUser(const std::string& email); | 117 User* CreatePublicAccountUser(const std::string& email); |
117 | 118 |
118 User* user_; | 119 User* user_; |
119 scoped_ptr<MockUserImageManager> user_image_manager_; | 120 scoped_ptr<MockUserImageManager> user_image_manager_; |
120 scoped_ptr<UserFlow> user_flow_; | 121 scoped_ptr<UserFlow> user_flow_; |
121 }; | 122 }; |
122 | 123 |
123 } // namespace chromeos | 124 } // namespace chromeos |
124 | 125 |
125 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ | 126 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_USER_MANAGER_H_ |
OLD | NEW |