#include "components/autofill/core/browser/address_data_manager.h"
#include <string>
#include <vector>
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/with_feature_override.h"
#include "base/uuid.h"
#include "build/buildflag.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/autofill_profile_test_api.h"
#include "components/autofill/core/browser/personal_data_manager_test_utils.h"
#include "components/autofill/core/browser/profile_token_quality_test_api.h"
#include "components/autofill/core/browser/strike_databases/test_inmemory_strike_database.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/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/base/signin_pref_names.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "components/sync/base/features.h"
#include "components/sync/service/sync_user_settings.h"
#include "components/sync/test/test_sync_service.h"
#include "components/webdata/common/web_database_service.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
namespace {
ElementsAre;
Pointee;
UnorderedElementsAre;
const base::Time kArbitraryTime = …;
const base::Time kSomeLaterTime = …;
const base::Time kMuchLaterTime = …;
constexpr char kGuid[] = …;
class MockAddressDataManagerObserver : public AddressDataManager::Observer { … };
class AddressDataManagerTest : public testing::Test { … };
TEST_F(AddressDataManagerTest, AddProfile) { … }
TEST_F(AddressDataManagerTest, UpdateProfile_ModificationDate) { … }
TEST_F(AddressDataManagerTest, GetProfiles) { … }
TEST_F(AddressDataManagerTest, GetProfiles_Order) { … }
TEST_F(AddressDataManagerTest, GetProfilesToSuggest_ProfileAutofillDisabled) { … }
TEST_F(AddressDataManagerTest,
GetProfilesToSuggest_NoProfilesLoadedIfDisabled) { … }
TEST_F(AddressDataManagerTest, GetProfilesToSuggest_NoProfilesAddedIfDisabled) { … }
TEST_F(AddressDataManagerTest, GetProfilesForSettings) { … }
TEST_F(AddressDataManagerTest, AddRemoveUpdateProfileSequence) { … }
TEST_F(AddressDataManagerTest, AddProfile_BasicInformation) { … }
TEST_F(AddressDataManagerTest, AddProfile_CrazyCharacters) { … }
TEST_F(AddressDataManagerTest, AddProfile_Invalid) { … }
TEST_F(AddressDataManagerTest, AddUpdateRemoveProfiles) { … }
TEST_F(AddressDataManagerTest, UpdateProfile_NewObservations) { … }
TEST_F(AddressDataManagerTest, UpdateProfile_ResetObservations) { … }
TEST_F(AddressDataManagerTest, IsEligibleForAddressAccountStorage) { … }
TEST_F(AddressDataManagerTest, IsCountryEligibleForAccountStorage) { … }
TEST_F(AddressDataManagerTest, MigrateProfileToAccount) { … }
TEST_F(AddressDataManagerTest, PopulateUniqueIDsOnLoad) { … }
TEST_F(AddressDataManagerTest, SetEmptyProfile) { … }
TEST_F(AddressDataManagerTest, Refresh) { … }
TEST_F(AddressDataManagerTest, UpdateLanguageCodeInProfile) { … }
TEST_F(AddressDataManagerTest, CreateDuplicateWithAnUpdate) { … }
TEST_F(AddressDataManagerTest,
CreateDuplicateWithAnUpdate_UpdatedProfileWasMoreRecentlyUsed) { … }
TEST_F(AddressDataManagerTest, RecordUseOf) { … }
TEST_F(AddressDataManagerTest, SaveProfileMigrationStrikes) { … }
TEST_F(AddressDataManagerTest, SaveProfileUpdateStrikes) { … }
TEST_F(AddressDataManagerTest, SaveProfileSaveStrikes) { … }
TEST_F(AddressDataManagerTest, ClearFullBrowsingHistory) { … }
TEST_F(AddressDataManagerTest, ClearUrlsFromBrowsingHistory) { … }
TEST_F(AddressDataManagerTest, ClearUrlsFromBrowsingHistoryInTimeRange) { … }
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
TEST_F(AddressDataManagerTest,
IsEligibleForAddressAccountStorageSigninPending) { … }
TEST_F(AddressDataManagerTest, AutofillSyncToggleAvailableInTransportMode) { … }
#endif
TEST_F(AddressDataManagerTest, ChangeCallbackIsTriggeredOnAddedProfile) { … }
}
}