#include "components/device_reauth/device_authenticator_common.h"
#include <memory>
#include <string>
#include "base/functional/callback.h"
#include "base/notreached.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/device_reauth/device_authenticator.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
class FakeDeviceAuthenticatorCommon : public DeviceAuthenticatorCommon { … };
FakeDeviceAuthenticatorCommon::FakeDeviceAuthenticatorCommon(
DeviceAuthenticatorProxy* proxy,
base::TimeDelta auth_validity_period)
: … { … }
FakeDeviceAuthenticatorCommon::~FakeDeviceAuthenticatorCommon() = default;
bool FakeDeviceAuthenticatorCommon::CanAuthenticateWithBiometrics() { … }
bool FakeDeviceAuthenticatorCommon::CanAuthenticateWithBiometricOrScreenLock() { … }
void FakeDeviceAuthenticatorCommon::Cancel() { … }
void FakeDeviceAuthenticatorCommon::AuthenticateWithMessage(
const std::u16string& message,
AuthenticateCallback callback) { … }
constexpr base::TimeDelta kAuthValidityPeriod = …;
}
class DeviceAuthenticatorCommonTest : public testing::Test { … };
TEST_F(DeviceAuthenticatorCommonTest, NeedAuthentication) { … }
TEST_F(DeviceAuthenticatorCommonTest, NeedAuthenticationImmediately) { … }