| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_LOGIN_AUTH_MOCK_AUTHENTICATOR_H_ | |
| 6 #define CHROMEOS_LOGIN_AUTH_MOCK_AUTHENTICATOR_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/message_loop/message_loop_proxy.h" | |
| 11 #include "chromeos/chromeos_export.h" | |
| 12 #include "chromeos/login/auth/authenticator.h" | |
| 13 #include "chromeos/login/auth/user_context.h" | |
| 14 #include "testing/gtest/include/gtest/gtest.h" | |
| 15 | |
| 16 namespace content { | |
| 17 class BrowserContext; | |
| 18 } | |
| 19 | |
| 20 namespace chromeos { | |
| 21 | |
| 22 class AuthStatusConsumer; | |
| 23 | |
| 24 class CHROMEOS_EXPORT MockAuthenticator : public Authenticator { | |
| 25 public: | |
| 26 MockAuthenticator(AuthStatusConsumer* consumer, | |
| 27 const UserContext& expected_user_context); | |
| 28 | |
| 29 // Authenticator: | |
| 30 void CompleteLogin(content::BrowserContext* context, | |
| 31 const UserContext& user_context) override; | |
| 32 void AuthenticateToLogin(content::BrowserContext* context, | |
| 33 const UserContext& user_context) override; | |
| 34 void AuthenticateToUnlock(const UserContext& user_context) override; | |
| 35 void LoginAsSupervisedUser(const UserContext& user_context) override; | |
| 36 void LoginOffTheRecord() override; | |
| 37 void LoginAsPublicSession(const UserContext& user_context) override; | |
| 38 void LoginAsKioskAccount(const std::string& app_user_id, | |
| 39 bool use_guest_mount) override; | |
| 40 void OnAuthSuccess() override; | |
| 41 void OnAuthFailure(const AuthFailure& failure) override; | |
| 42 void RecoverEncryptedData(const std::string& old_password) override; | |
| 43 void ResyncEncryptedData() override; | |
| 44 | |
| 45 virtual void SetExpectedCredentials(const UserContext& user_context); | |
| 46 | |
| 47 protected: | |
| 48 ~MockAuthenticator() override; | |
| 49 | |
| 50 private: | |
| 51 UserContext expected_user_context_; | |
| 52 scoped_refptr<base::MessageLoopProxy> message_loop_; | |
| 53 | |
| 54 DISALLOW_COPY_AND_ASSIGN(MockAuthenticator); | |
| 55 }; | |
| 56 | |
| 57 } // namespace chromeos | |
| 58 | |
| 59 #endif // CHROMEOS_LOGIN_AUTH_MOCK_AUTHENTICATOR_H_ | |
| OLD | NEW |