chromium/components/data_sharing/internal/collaboration_group_sync_bridge_unittest.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/data_sharing/internal/collaboration_group_sync_bridge.h"

#include <memory>
#include <set>

#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/mock_callback.h"
#include "base/test/protobuf_matchers.h"
#include "base/test/task_environment.h"
#include "components/sync/model/data_batch.h"
#include "components/sync/model/data_type_store.h"
#include "components/sync/protocol/collaboration_group_specifics.pb.h"
#include "components/sync/test/data_type_store_test_util.h"
#include "components/sync/test/mock_data_type_local_change_processor.h"
#include "components/sync/test/test_matchers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace data_sharing {
namespace {

EqualsProto;
HasInitialSyncDone;
IsEmptyMetadataBatch;
NoModelError;
_;
ElementsAre;
Eq;
InvokeWithoutArgs;
IsEmpty;
IsNull;
SizeIs;
UnorderedElementsAre;

sync_pb::CollaborationGroupSpecifics MakeSpecifics(
    const GroupId& id,
    const base::Time& changed_at = base::Time::Now()) {}

syncer::EntityData EntityDataFromSpecifics(
    const sync_pb::CollaborationGroupSpecifics& specifics) {}

std::unique_ptr<syncer::EntityChange> EntityChangeAddFromSpecifics(
    const sync_pb::CollaborationGroupSpecifics& specifics) {}

std::unique_ptr<syncer::EntityChange> EntityChangeUpdateFromSpecifics(
    const sync_pb::CollaborationGroupSpecifics& specifics) {}

std::unique_ptr<syncer::EntityChange> EntityChangeDeleteFromSpecifics(
    const sync_pb::CollaborationGroupSpecifics& specifics) {}

std::vector<sync_pb::CollaborationGroupSpecifics> ExtractSpecificsFromDataBatch(
    std::unique_ptr<syncer::DataBatch> data_batch) {}

class MockObserver : public CollaborationGroupSyncBridge::Observer {};

class CollaborationGroupSyncBridgeTest : public testing::Test {};

TEST_F(CollaborationGroupSyncBridgeTest, ShouldReturnClientTag) {}

TEST_F(CollaborationGroupSyncBridgeTest, ShouldReturnStorageKey) {}

TEST_F(CollaborationGroupSyncBridgeTest, ShouldValidateEntityData) {}

TEST_F(CollaborationGroupSyncBridgeTest, ShouldMergeFullSyncData) {}

TEST_F(CollaborationGroupSyncBridgeTest,
       ShouldApplyIncrementalSyncChangesAndNotifyObserver) {}

TEST_F(CollaborationGroupSyncBridgeTest, ShouldStoreAndLoadMetadata) {}

TEST_F(CollaborationGroupSyncBridgeTest, ShouldStoreAndLoadData) {}

TEST_F(CollaborationGroupSyncBridgeTest, ShouldApplyDisableSyncChanges) {}

}  // namespace
}  // namespace data_sharing