OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_PROXIMITY_AUTH_MOCK_PROXIMITY_AUTH_CLIENT_H_ |
| 6 #define COMPONENTS_PROXIMITY_AUTH_MOCK_PROXIMITY_AUTH_CLIENT_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/proximity_auth/cryptauth/cryptauth_client.h" |
| 11 #include "components/proximity_auth/cryptauth/cryptauth_device_manager.h" |
| 12 #include "components/proximity_auth/cryptauth/cryptauth_enrollment_manager.h" |
| 13 #include "components/proximity_auth/cryptauth/secure_message_delegate.h" |
| 14 #include "components/proximity_auth/proximity_auth_client.h" |
| 15 #include "testing/gmock/include/gmock/gmock.h" |
| 16 |
| 17 namespace proximity_auth { |
| 18 |
| 19 // Mock implementation of ProximityAuthClient. |
| 20 class MockProximityAuthClient : public ProximityAuthClient { |
| 21 public: |
| 22 MockProximityAuthClient(); |
| 23 ~MockProximityAuthClient() override; |
| 24 |
| 25 // ProximityAuthClient: |
| 26 MOCK_METHOD1(UpdateScreenlockState, |
| 27 void(proximity_auth::ScreenlockState state)); |
| 28 MOCK_METHOD1(FinalizeUnlock, void(bool success)); |
| 29 MOCK_METHOD1(FinalizeSignin, void(const std::string& secret)); |
| 30 MOCK_CONST_METHOD0(GetAuthenticatedUsername, std::string(void)); |
| 31 MOCK_METHOD0(GetPrefService, PrefService*(void)); |
| 32 MOCK_METHOD0(GetDeviceClassifier, cryptauth::DeviceClassifier(void)); |
| 33 MOCK_METHOD0(GetAccountId, std::string(void)); |
| 34 MOCK_METHOD0(GetCryptAuthEnrollmentManager, |
| 35 CryptAuthEnrollmentManager*(void)); |
| 36 MOCK_METHOD0(GetCryptAuthDeviceManager, CryptAuthDeviceManager*(void)); |
| 37 scoped_ptr<SecureMessageDelegate> CreateSecureMessageDelegate() override; |
| 38 scoped_ptr<CryptAuthClientFactory> CreateCryptAuthClientFactory() override; |
| 39 |
| 40 // Proxy mock methods because implementation requires returning scoped_ptr. |
| 41 MOCK_METHOD0(CreateSecureMessageDelegatePtr, SecureMessageDelegate*(void)); |
| 42 MOCK_METHOD0(CreateCryptAuthClientFactoryPtr, CryptAuthClientFactory*(void)); |
| 43 |
| 44 private: |
| 45 DISALLOW_COPY_AND_ASSIGN(MockProximityAuthClient); |
| 46 }; |
| 47 |
| 48 } // namespace proximity_auth |
| 49 |
| 50 #endif // COMPONENTS_PROXIMITY_AUTH_MOCK_PROXIMITY_AUTH_CLIENT_H_ |
OLD | NEW |