#include "components/sync/engine/syncer.h"
#include <stddef.h>
#include <algorithm>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/sync/base/client_tag_hash.h"
#include "components/sync/base/extensions_activity.h"
#include "components/sync/base/features.h"
#include "components/sync/base/time.h"
#include "components/sync/base/unique_position.h"
#include "components/sync/engine/active_devices_invalidation_info.h"
#include "components/sync/engine/backoff_delay_provider.h"
#include "components/sync/engine/cancelation_signal.h"
#include "components/sync/engine/cycle/sync_cycle_context.h"
#include "components/sync/engine/data_type_activation_response.h"
#include "components/sync/engine/forwarding_data_type_processor.h"
#include "components/sync/engine/net/server_connection_manager.h"
#include "components/sync/engine/nigori/keystore_keys_handler.h"
#include "components/sync/engine/sync_scheduler_impl.h"
#include "components/sync/engine/syncer_proto_util.h"
#include "components/sync/protocol/bookmark_specifics.pb.h"
#include "components/sync/protocol/client_commands.pb.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/preference_specifics.pb.h"
#include "components/sync/protocol/sync.pb.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "components/sync/test/fake_sync_encryption_handler.h"
#include "components/sync/test/mock_connection_manager.h"
#include "components/sync/test/mock_data_type_processor.h"
#include "components/sync/test/mock_debug_info_getter.h"
#include "components/sync/test/mock_nudge_handler.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
namespace {
ElementsAre;
IsEmpty;
UnorderedElementsAre;
sync_pb::EntitySpecifics MakeSpecifics(DataType data_type) { … }
sync_pb::EntitySpecifics MakeBookmarkSpecificsToCommit() { … }
}
class SyncerTest : public testing::Test,
public SyncCycle::Delegate,
public SyncEngineEventListener { … };
TEST_F(SyncerTest, CommitFiltersThrottledEntries) { … }
TEST_F(SyncerTest, GetUpdatesPartialThrottled) { … }
TEST_F(SyncerTest, GetUpdatesPartialFailure) { … }
TEST_F(SyncerTest, TestSimpleCommit) { … }
TEST_F(SyncerTest, TestSimpleGetUpdates) { … }
TEST_F(SyncerTest, CommitManyItemsInOneGo_Success) { … }
TEST_F(SyncerTest, CommitManyItemsInOneGo_PostBufferFail) { … }
TEST_F(SyncerTest, CommitManyItemsInOneGo_CommitConflict) { … }
TEST_F(SyncerTest, SendDebugInfoEventsOnGetUpdates_HappyCase) { … }
TEST_F(SyncerTest, SendDebugInfoEventsOnGetUpdates_PostFailsDontDrop) { … }
TEST_F(SyncerTest, CommitFailureWithConflict) { … }
TEST_F(SyncerTest, SendDebugInfoEventsOnCommit_HappyCase) { … }
TEST_F(SyncerTest, SendDebugInfoEventsOnCommit_PostFailsDontDrop) { … }
TEST_F(SyncerTest, TestClientCommandDuringUpdate) { … }
TEST_F(SyncerTest, TestClientCommandDuringCommit) { … }
TEST_F(SyncerTest, ShouldPopulateSingleClientFlag) { … }
TEST_F(SyncerTest,
ShouldPopulateSingleClientFlagForStandaloneInvalidationsOnly) { … }
TEST_F(SyncerTest, ShouldPopulateSingleClientForOldInvalidations) { … }
TEST_F(SyncerTest, ShouldPopulateFcmRegistrationTokens) { … }
TEST_F(SyncerTest, ShouldPopulateFcmRegistrationTokensForInterestedTypesOnly) { … }
TEST_F(SyncerTest, ShouldNotPopulateTooManyFcmRegistrationTokens) { … }
TEST_F(SyncerTest,
ShouldNotPopulateOptimizationFlagsIfDeviceInfoRecentlyUpdated) { … }
TEST_F(SyncerTest, ClientTagServerCreatedUpdatesWork) { … }
TEST_F(SyncerTest, GetUpdatesSetsRequestedTypes) { … }
TEST_F(SyncerTest, UpdateThenCommit) { … }
TEST_F(SyncerTest, UpdateFailsThenDontCommit) { … }
TEST_F(SyncerTest, ConfigureDownloadsTwoBatchesSuccess) { … }
TEST_F(SyncerTest, ConfigureFailsDontApplyUpdates) { … }
TEST_F(SyncerTest, ConfigureFailedUnregisteredType) { … }
TEST_F(SyncerTest, GetKeySuccess) { … }
TEST_F(SyncerTest, GetKeyEmpty) { … }
TEST_F(SyncerTest, CommitOnlyTypes) { … }
enum { … };
class MixedResult : public SyncerTest,
public ::testing::WithParamInterface<int> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(MixedResult, ExtensionsActivity) { … }
}