#include "components/sync/test/mock_data_type_processor.h"
#include <utility>
#include "base/base64.h"
#include "base/functional/bind.h"
#include "base/hash/sha1.h"
#include "base/uuid.h"
#include "components/sync/base/client_tag_hash.h"
#include "components/sync/engine/commit_queue.h"
#include "components/sync/protocol/data_type_progress_marker.pb.h"
#include "components/sync/protocol/data_type_state.pb.h"
#include "components/sync/protocol/entity_specifics.pb.h"
namespace syncer {
MockDataTypeProcessor::MockDataTypeProcessor() : … { … }
MockDataTypeProcessor::~MockDataTypeProcessor() = default;
void MockDataTypeProcessor::ConnectSync(
std::unique_ptr<CommitQueue> commit_queue) { … }
void MockDataTypeProcessor::DisconnectSync() { … }
void MockDataTypeProcessor::GetLocalChanges(size_t max_entries,
GetLocalChangesCallback callback) { … }
void MockDataTypeProcessor::OnCommitCompleted(
const sync_pb::DataTypeState& type_state,
const CommitResponseDataList& committed_response_list,
const FailedCommitResponseDataList& error_response_list) { … }
void MockDataTypeProcessor::OnCommitFailed(SyncCommitError commit_error) { … }
void MockDataTypeProcessor::OnUpdateReceived(
const sync_pb::DataTypeState& type_state,
UpdateResponseDataList response_list,
std::optional<sync_pb::GarbageCollectionDirective> gc_directive) { … }
void MockDataTypeProcessor::SetSynchronousExecution(bool is_synchronous) { … }
void MockDataTypeProcessor::RunQueuedTasks() { … }
std::unique_ptr<CommitRequestData> MockDataTypeProcessor::CommitRequest(
const ClientTagHash& tag_hash,
const sync_pb::EntitySpecifics& specifics) { … }
std::unique_ptr<CommitRequestData> MockDataTypeProcessor::CommitRequest(
const ClientTagHash& tag_hash,
const sync_pb::EntitySpecifics& specifics,
const std::string& server_id) { … }
std::unique_ptr<CommitRequestData> MockDataTypeProcessor::DeleteRequest(
const ClientTagHash& tag_hash) { … }
size_t MockDataTypeProcessor::GetNumCommitFailures() const { … }
size_t MockDataTypeProcessor::GetNumUpdateResponses() const { … }
std::vector<const UpdateResponseData*>
MockDataTypeProcessor::GetNthUpdateResponse(size_t n) const { … }
sync_pb::DataTypeState MockDataTypeProcessor::GetNthUpdateState(
size_t n) const { … }
sync_pb::GarbageCollectionDirective MockDataTypeProcessor::GetNthGcDirective(
size_t n) const { … }
size_t MockDataTypeProcessor::GetNumCommitResponses() const { … }
CommitResponseDataList MockDataTypeProcessor::GetNthCommitResponse(
size_t n) const { … }
sync_pb::DataTypeState MockDataTypeProcessor::GetNthCommitState(
size_t n) const { … }
bool MockDataTypeProcessor::HasUpdateResponse(
const ClientTagHash& tag_hash) const { … }
const UpdateResponseData& MockDataTypeProcessor::GetUpdateResponse(
const ClientTagHash& tag_hash) const { … }
bool MockDataTypeProcessor::HasCommitResponse(
const ClientTagHash& tag_hash) const { … }
CommitResponseData MockDataTypeProcessor::GetCommitResponse(
const ClientTagHash& tag_hash) const { … }
void MockDataTypeProcessor::SetDisconnectCallback(
DisconnectCallback callback) { … }
void MockDataTypeProcessor::SetCommitRequest(
CommitRequestDataList commit_request) { … }
void MockDataTypeProcessor::AppendCommitRequest(
const ClientTagHash& tag_hash,
const sync_pb::EntitySpecifics& specifics) { … }
void MockDataTypeProcessor::AppendCommitRequest(
const ClientTagHash& tag_hash,
const sync_pb::EntitySpecifics& specifics,
const std::string& server_id) { … }
int MockDataTypeProcessor::GetLocalChangesCallCount() const { … }
int MockDataTypeProcessor::GetStoreInvalidationsCallCount() const { … }
void MockDataTypeProcessor::OnCommitCompletedImpl(
const sync_pb::DataTypeState& type_state,
const CommitResponseDataList& committed_response_list,
const FailedCommitResponseDataList& error_response_list) { … }
void MockDataTypeProcessor::OnUpdateReceivedImpl(
const sync_pb::DataTypeState& type_state,
UpdateResponseDataList response_list,
std::optional<sync_pb::GarbageCollectionDirective> gc_directive) { … }
void MockDataTypeProcessor::StorePendingInvalidations(
std::vector<sync_pb::DataTypeState::Invalidation> invalidations_to_store) { … }
int64_t MockDataTypeProcessor::GetCurrentSequenceNumber(
const ClientTagHash& tag_hash) const { … }
int64_t MockDataTypeProcessor::GetNextSequenceNumber(
const ClientTagHash& tag_hash) { … }
int64_t MockDataTypeProcessor::GetBaseVersion(
const ClientTagHash& tag_hash) const { … }
void MockDataTypeProcessor::SetBaseVersion(const ClientTagHash& tag_hash,
int64_t version) { … }
bool MockDataTypeProcessor::HasServerAssignedId(
const ClientTagHash& tag_hash) const { … }
const std::string& MockDataTypeProcessor::GetServerAssignedId(
const ClientTagHash& tag_hash) const { … }
void MockDataTypeProcessor::SetServerAssignedId(const ClientTagHash& tag_hash,
const std::string& id) { … }
}