#include "base/location.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/reading_list/reading_list_model_factory.h"
#include "chrome/browser/sync/test/integration/fake_server_match_status_checker.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "components/reading_list/core/mock_reading_list_model_observer.h"
#include "components/reading_list/core/reading_list_entry.h"
#include "components/reading_list/core/reading_list_model.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/base/time.h"
#include "components/sync/engine/loopback_server/persistent_unique_client_entity.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/proto_value_conversions.h"
#include "components/sync/protocol/reading_list_specifics.pb.h"
#include "components/sync/test/test_matchers.h"
#include "components/version_info/version_info.h"
#include "content/public/test/browser_test.h"
namespace {
MatchesDeletionOrigin;
ElementsAre;
Eq;
class ServerReadingListURLsEqualityChecker
: public fake_server::FakeServerMatchStatusChecker { … };
class LocalReadingListURLsEqualityChecker
: public StatusChangeChecker,
public testing::NiceMock<MockReadingListModelObserver> { … };
class ServerReadingListTitlesEqualityChecker
: public fake_server::FakeServerMatchStatusChecker { … };
void WaitForReadingListModelLoaded(ReadingListModel* reading_list_model) { … }
std::unique_ptr<syncer::LoopbackServerEntity> CreateTestReadingListEntity(
const GURL& url,
const std::string& entry_title) { … }
class SingleClientReadingListSyncTest : public SyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest,
ShouldDownloadAccountDataUponSignin) { … }
IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest,
ShouldUploadOnlyEntriesCreatedAfterSignin) { … }
IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest,
ShouldDeleteTheDeletedEntryFromTheServer) { … }
IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest,
ShouldDeleteAllEntriesFromTheServer) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest,
ShouldDeleteAccountDataUponSignout) { … }
IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest,
ShouldUpdateEntriesLocallyAndServerSide) { … }
IN_PROC_BROWSER_TEST_F(SingleClientReadingListSyncTest,
ShouldUploadAllEntriesToTheSyncServer) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
ShouldFilterEntriesWithEmptyEntryIdUponIncrementalRemoteCreation) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
ShouldFilterEntriesWithEmptyUrlUponIncrementalRemoteCreation) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
ShouldFilterEntriesWithUnequalEntryIdAndUrlUponIncrementalRemoteCreation) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
ShouldFilterEntriesWithInvalidUrlUponIncrementalRemoteCreation) { … }
#if BUILDFLAG(IS_ANDROID)
#define MAYBE_ShouldFilterEntriesWithEmptyEntryIdUponIncrementalRemoteUpdate …
#else
#define MAYBE_ShouldFilterEntriesWithEmptyEntryIdUponIncrementalRemoteUpdate …
#endif
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
MAYBE_ShouldFilterEntriesWithEmptyEntryIdUponIncrementalRemoteUpdate) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
ShouldFilterEntriesWithEmptyUrlUponIncrementalRemoteUpdate) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
ShouldFilterEntriesWithUnequalEntryIdAndUrlUponIncrementalRemoteUpdate) { … }
IN_PROC_BROWSER_TEST_F(
SingleClientReadingListSyncTest,
ShouldFilterEntriesWithInvalidUrlUponIncrementalRemoteUpdate) { … }
#endif
}