#include "components/autofill/core/browser/webdata/addresses/autofill_profile_sync_difference_tracker.h"
#include "base/files/scoped_temp_dir.h"
#include "base/functional/callback_helpers.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/geo/country_names.h"
#include "components/autofill/core/browser/test_autofill_clock.h"
#include "components/autofill/core/browser/webdata/addresses/address_autofill_table.h"
#include "components/autofill/core/browser/webdata/addresses/autofill_profile_sync_util.h"
#include "components/autofill/core/common/autofill_constants.h"
#include "components/sync/model/model_error.h"
#include "components/webdata/common/web_database.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
namespace {
ASCIIToUTF16;
MockCallback;
ElementsAre;
IsEmpty;
const char kSmallerGuid[] = …;
const char kBiggerGuid[] = …;
const char kLocaleString[] = …;
const base::Time kJune2017 = …;
struct UpdatesToSync { … };
}
class AutofillProfileSyncDifferenceTrackerTestBase : public testing::Test { … };
class AutofillProfileSyncDifferenceTrackerTest
: public AutofillProfileSyncDifferenceTrackerTestBase { … };
TEST_F(AutofillProfileSyncDifferenceTrackerTest,
IncorporateRemoteProfileShouldOverwriteProfileWithSameKey) { … }
TEST_F(AutofillProfileSyncDifferenceTrackerTest,
IncorporateRemoteProfileShouldNotOverwriteFullNameByEmptyString) { … }
TEST_F(
AutofillProfileSyncDifferenceTrackerTest,
IncorporateRemoteProfileShouldKeepRemoteKeyWhenMergingDuplicateProfileWithBiggerKey) { … }
TEST_F(
AutofillProfileSyncDifferenceTrackerTest,
IncorporateRemoteProfileShouldKeepRemoteKeyAndLocalOriginWhenMergingDuplicateProfileWithBiggerKey) { … }
TEST_F(
AutofillProfileSyncDifferenceTrackerTest,
IncorporateRemoteProfileShouldKeepLocalKeyWhenMergingDuplicateProfileWithSmallerKey) { … }
TEST_F(
AutofillProfileSyncDifferenceTrackerTest,
IncorporateRemoteProfileShouldKeepLocalKeyAndRemoteOriginWhenMergingDuplicateProfileWithSmallerKey) { … }
TEST_F(AutofillProfileSyncDifferenceTrackerTest,
FlushToLocalShouldNotCallbackWhenNotNeeded) { … }
TEST_F(AutofillProfileSyncDifferenceTrackerTest,
FlushToLocalShouldCallbackWhenProfileDeleted) { … }
TEST_F(AutofillProfileSyncDifferenceTrackerTest,
FlushToLocalShouldCallbackWhenProfileAdded) { … }
TEST_F(AutofillProfileSyncDifferenceTrackerTest,
FlushToLocalShouldCallbackWhenProfileUpdated) { … }
class AutofillProfileInitialSyncDifferenceTrackerTest
: public AutofillProfileSyncDifferenceTrackerTestBase { … };
TEST_F(AutofillProfileInitialSyncDifferenceTrackerTest,
MergeSimilarEntriesForInitialSyncShouldSyncUpChanges) { … }
TEST_F(AutofillProfileInitialSyncDifferenceTrackerTest,
MergeSimilarEntriesForInitialSyncShouldNotSyncUpWhenNotNeeded) { … }
TEST_F(AutofillProfileInitialSyncDifferenceTrackerTest,
MergeSimilarEntriesForInitialSyncNotMatchNonsimilarEntries) { … }
}