#include "device/fido/fake_fido_discovery.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/notreached.h"
#include "base/task/sequenced_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
namespace test {
FakeFidoDiscovery::FakeFidoDiscovery(FidoTransportProtocol transport,
StartMode mode)
: … { … }
FakeFidoDiscovery::~FakeFidoDiscovery() = default;
void FakeFidoDiscovery::WaitForCallToStart() { … }
void FakeFidoDiscovery::SimulateStarted(bool success) { … }
void FakeFidoDiscovery::WaitForCallToStartAndSimulateSuccess() { … }
void FakeFidoDiscovery::StartInternal() { … }
FakeFidoDiscoveryFactory::FakeFidoDiscoveryFactory() = default;
FakeFidoDiscoveryFactory::~FakeFidoDiscoveryFactory() = default;
FakeFidoDiscovery* FakeFidoDiscoveryFactory::ForgeNextHidDiscovery(
FakeFidoDiscovery::StartMode mode) { … }
FakeFidoDiscovery* FakeFidoDiscoveryFactory::ForgeNextNfcDiscovery(
FakeFidoDiscovery::StartMode mode) { … }
FakeFidoDiscovery* FakeFidoDiscoveryFactory::ForgeNextCableDiscovery(
FakeFidoDiscovery::StartMode mode) { … }
FakeFidoDiscovery* FakeFidoDiscoveryFactory::ForgeNextPlatformDiscovery(
FakeFidoDiscovery::StartMode mode) { … }
void FakeFidoDiscoveryFactory::set_discover_win_webauthn_api_authenticator(
bool on) { … }
std::vector<std::unique_ptr<FidoDiscoveryBase>>
FakeFidoDiscoveryFactory::Create(FidoTransportProtocol transport) { … }
#if BUILDFLAG(IS_WIN)
std::unique_ptr<device::FidoDiscoveryBase>
FakeFidoDiscoveryFactory::MaybeCreateWinWebAuthnApiDiscovery() {
if (!discover_win_webauthn_api_authenticator_) {
return nullptr;
}
return FidoDiscoveryFactory::MaybeCreateWinWebAuthnApiDiscovery();
}
#endif
}
}