mock_biometric_authenticator.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2021 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. #ifndef COMPONENTS_DEVICE_REAUTH_MOCK_BIOMETRIC_AUTHENTICATOR_H_
  5. #define COMPONENTS_DEVICE_REAUTH_MOCK_BIOMETRIC_AUTHENTICATOR_H_
  6. #include "base/callback.h"
  7. #include "components/device_reauth/biometric_authenticator.h"
  8. #include "testing/gmock/include/gmock/gmock.h"
  9. namespace device_reauth {
  10. // Mocked BiometricAuthenticator used by unit tests.
  11. class MockBiometricAuthenticator : public BiometricAuthenticator {
  12. public:
  13. MockBiometricAuthenticator();
  14. MOCK_METHOD(bool, CanAuthenticate, (BiometricAuthRequester), (override));
  15. MOCK_METHOD(void,
  16. Authenticate,
  17. (BiometricAuthRequester, AuthenticateCallback, bool),
  18. (override));
  19. MOCK_METHOD(void,
  20. AuthenticateWithMessage,
  21. (BiometricAuthRequester,
  22. const std::u16string,
  23. AuthenticateCallback),
  24. (override));
  25. MOCK_METHOD(void, Cancel, (BiometricAuthRequester), (override));
  26. private:
  27. ~MockBiometricAuthenticator() override;
  28. };
  29. } // namespace device_reauth
  30. #endif // COMPONENTS_DEVICE_REAUTH_MOCK_BIOMETRIC_AUTHENTICATOR_H_