#include "components/sync/model/syncable_service_based_bridge.h"
#include <string_view>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "components/sync/base/client_tag_hash.h"
#include "components/sync/engine/data_type_activation_response.h"
#include "components/sync/model/client_tag_based_data_type_processor.h"
#include "components/sync/model/conflict_resolution.h"
#include "components/sync/model/model_error.h"
#include "components/sync/model/sync_change.h"
#include "components/sync/model/syncable_service.h"
#include "components/sync/protocol/persisted_entity_data.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/mock_data_type_worker.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
namespace {
_;
ElementsAre;
Eq;
Invoke;
IsEmpty;
NotNull;
Pair;
Return;
const DataType kDataType = …;
const std::string_view kSyncableServiceStartTimeHistogramName = …;
sync_pb::EntitySpecifics GetTestSpecifics(const std::string& name = "name") { … }
MATCHER_P(SyncDataMatches, name, "") { … }
MATCHER_P2(SyncChangeMatches, change_type, name, "") { … }
MATCHER_P(HasName, name, "") { … }
class MockSyncableService : public SyncableService { … };
class SyncableServiceBasedBridgeTest : public ::testing::Test { … };
TEST_F(SyncableServiceBasedBridgeTest,
ShouldStartSyncingWithEmptyInitialRemoteData) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldStartSyncingWithNonEmptyInitialRemoteData) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldWaitUntilModelReadyToSync) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldStopSyncableServiceIfPreviouslyStarted) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldStopSyncableServiceDuringShutdownIfPreviouslyStarted) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldNotStopSyncableServiceIfNotPreviouslyStarted) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldNotStopSyncableServiceDuringShutdownIfNotPreviouslyStarted) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldPropagateErrorDuringStart) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldKeepSyncingWhenSyncStoppedTemporarily) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldStartSyncingWithPreviousDirectoryDataAfterRestart) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldSupportDisableReenableSequence) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldPropagateLocalEntitiesDuringMerge) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldPropagateLocalCreation) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldPropagateLocalUpdate) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldPropagateLocalDeletion) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldIgnoreLocalCreationIfPreviousError) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldPropagateRemoteCreation) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldPropagateRemoteUpdates) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldPropagateRemoteDeletion) { … }
TEST(SyncableServiceBasedBridgeLocalChangeProcessorTest,
ShouldDropIfCommitted) { … }
TEST(SyncableServiceBasedBridgeLocalChangeProcessorTest,
ShouldNotDropIfUnsynced) { … }
TEST_F(SyncableServiceBasedBridgeTest, ConflictShouldUseRemote) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ConflictWithRemoteDeletionShouldUseLocal) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ConflictWithRemoteExtensionUninstallShouldUseRemote) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ConflictWithRemoteAppUninstallShouldUseRemote) { … }
TEST_F(SyncableServiceBasedBridgeTest, ShouldMeasureSyncableServiceStartTime) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldNotMeasureSyncableServiceStartTimeIfNoInitialData) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldNotMeasureSyncableServiceStartTimeOnSyncRestart) { … }
TEST_F(SyncableServiceBasedBridgeTest,
ShouldNotMeasureSyncableServiceStartTimeOnError) { … }
}
}