#include "chrome/browser/sync/test/integration/webauthn_credentials_helper.h"
#include <vector>
#include "base/rand_util.h"
#include "chrome/browser/sync/test/integration/fake_server_match_status_checker.h"
#include "chrome/browser/sync/test/integration/single_client_status_change_checker.h"
#include "chrome/browser/sync/test/integration/sync_datatype_helper.h"
#include "chrome/browser/sync/test/integration/sync_integration_test_util.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/webauthn/passkey_model_factory.h"
#include "components/sync/base/data_type.h"
#include "components/sync/protocol/sync_entity.pb.h"
#include "components/sync/protocol/webauthn_credential_specifics.pb.h"
#include "components/webauthn/core/browser/passkey_model.h"
#include "components/webauthn/core/browser/passkey_model_change.h"
#include "components/webauthn/core/browser/passkey_sync_bridge.h"
namespace webauthn_credentials_helper {
test;
namespace {
int g_timestamp = …;
class WebAuthnCredentialsSyncIdEqualsChecker
: public MultiClientStatusChangeChecker { … };
}
PasskeySyncActiveChecker::PasskeySyncActiveChecker(
syncer::SyncServiceImpl* service)
: … { … }
PasskeySyncActiveChecker::~PasskeySyncActiveChecker() = default;
bool PasskeySyncActiveChecker::IsExitConditionSatisfied(std::ostream* os) { … }
LocalPasskeysChangedChecker::LocalPasskeysChangedChecker(int profile)
: … { … }
LocalPasskeysChangedChecker::~LocalPasskeysChangedChecker() = default;
bool LocalPasskeysChangedChecker::IsExitConditionSatisfied(std::ostream* os) { … }
void LocalPasskeysChangedChecker::OnPasskeysChanged(
const std::vector<webauthn::PasskeyModelChange>& changes) { … }
void LocalPasskeysChangedChecker::OnPasskeyModelShuttingDown() { … }
LocalPasskeysMatchChecker::LocalPasskeysMatchChecker(int profile,
Matcher matcher)
: … { … }
LocalPasskeysMatchChecker::~LocalPasskeysMatchChecker() = default;
bool LocalPasskeysMatchChecker::IsExitConditionSatisfied(std::ostream* os) { … }
void LocalPasskeysMatchChecker::OnPasskeysChanged(
const std::vector<webauthn::PasskeyModelChange>& changes) { … }
void LocalPasskeysMatchChecker::OnPasskeyModelShuttingDown() { … }
ServerPasskeysMatchChecker::ServerPasskeysMatchChecker(Matcher matcher)
: … { … }
ServerPasskeysMatchChecker::~ServerPasskeysMatchChecker() = default;
bool ServerPasskeysMatchChecker::IsExitConditionSatisfied(std::ostream* os) { … }
PasskeyChangeObservationChecker::PasskeyChangeObservationChecker(
int profile,
ChangeList expected_changes)
: … { … }
PasskeyChangeObservationChecker::~PasskeyChangeObservationChecker() = default;
bool PasskeyChangeObservationChecker::IsExitConditionSatisfied(
std::ostream* os) { … }
void PasskeyChangeObservationChecker::OnPasskeysChanged(
const std::vector<webauthn::PasskeyModelChange>& changes) { … }
void PasskeyChangeObservationChecker::OnPasskeyModelShuttingDown() { … }
MockPasskeyModelObserver::MockPasskeyModelObserver(
webauthn::PasskeyModel* model) { … }
MockPasskeyModelObserver::~MockPasskeyModelObserver() = default;
webauthn::PasskeySyncBridge& GetModel(int profile_idx) { … }
bool AwaitAllModelsMatch() { … }
sync_pb::WebauthnCredentialSpecifics NewPasskey() { … }
sync_pb::WebauthnCredentialSpecifics NewShadowingPasskey(
const sync_pb::WebauthnCredentialSpecifics& shadowed) { … }
}