| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_USERS_FAKE_CHROME_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class FakeSupervisedUserManager; | 22 class FakeSupervisedUserManager; |
| 23 | 23 |
| 24 // Fake chrome user manager with a barebones implementation. Users can be added | 24 // Fake chrome user manager with a barebones implementation. Users can be added |
| 25 // and set as logged in, and those users can be returned. | 25 // and set as logged in, and those users can be returned. |
| 26 class FakeChromeUserManager : public ChromeUserManager { | 26 class FakeChromeUserManager : public ChromeUserManager { |
| 27 public: | 27 public: |
| 28 FakeChromeUserManager(); | 28 FakeChromeUserManager(); |
| 29 ~FakeChromeUserManager() override; | 29 ~FakeChromeUserManager() override; |
| 30 | 30 |
| 31 // Create and add a kiosk app user. | 31 // Create and add various types of users. |
| 32 user_manager::User* AddKioskAppUser(const AccountId& account_id); | 32 user_manager::User* AddKioskAppUser(const AccountId& account_id); |
| 33 user_manager::User* AddArcKioskAppUser(const AccountId& account_id); | 33 user_manager::User* AddArcKioskAppUser(const AccountId& account_id); |
| 34 | 34 user_manager::User* AddSupervisedUser(const AccountId& account_id); |
| 35 // Create and add a public account user. | |
| 36 const user_manager::User* AddPublicAccountUser(const AccountId& account_id); | 35 const user_manager::User* AddPublicAccountUser(const AccountId& account_id); |
| 37 | 36 |
| 38 // Calculates the user name hash and calls UserLoggedIn to login a user. | 37 // Calculates the user name hash and calls UserLoggedIn to login a user. |
| 39 void LoginUser(const AccountId& account_id); | 38 // |set_profile_created| forces the user to have its profile marked created. |
| 39 // NOTE: This does not match production, which creates the profile later. |
| 40 // However, many tests rely on this behavior. |
| 41 void LoginUser(const AccountId& account_id, bool set_profile_created = true); |
| 40 | 42 |
| 41 const user_manager::User* AddUser(const AccountId& account_id); | 43 const user_manager::User* AddUser(const AccountId& account_id); |
| 42 const user_manager::User* AddUserWithAffiliation(const AccountId& account_id, | 44 const user_manager::User* AddUserWithAffiliation(const AccountId& account_id, |
| 43 bool is_affiliated); | 45 bool is_affiliated); |
| 44 | 46 |
| 45 // user_manager::UserManager override. | 47 // user_manager::UserManager override. |
| 46 void Shutdown() override; | 48 void Shutdown() override; |
| 47 const user_manager::UserList& GetUsers() const override; | 49 const user_manager::UserList& GetUsers() const override; |
| 48 user_manager::UserList GetUsersAllowedForMultiProfile() const override; | 50 user_manager::UserList GetUsersAllowedForMultiProfile() const override; |
| 49 const user_manager::UserList& GetLoggedInUsers() const override; | 51 const user_manager::UserList& GetLoggedInUsers() const override; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Specific flows by user e-mail. | 209 // Specific flows by user e-mail. |
| 208 // Keys should be canonicalized before access. | 210 // Keys should be canonicalized before access. |
| 209 FlowMap specific_flows_; | 211 FlowMap specific_flows_; |
| 210 | 212 |
| 211 DISALLOW_COPY_AND_ASSIGN(FakeChromeUserManager); | 213 DISALLOW_COPY_AND_ASSIGN(FakeChromeUserManager); |
| 212 }; | 214 }; |
| 213 | 215 |
| 214 } // namespace chromeos | 216 } // namespace chromeos |
| 215 | 217 |
| 216 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ | 218 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_CHROME_USER_MANAGER_H_ |
| OLD | NEW |