#include "components/autofill/core/browser/payments/local_card_migration_manager.h"
#include <stddef.h>
#include <algorithm>
#include <list>
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/metrics/metrics_hashes.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "base/uuid.h"
#include "build/build_config.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/credit_card.h"
#include "components/autofill/core/browser/metrics/autofill_metrics.h"
#include "components/autofill/core/browser/metrics/payments/local_card_migration_metrics.h"
#include "components/autofill/core/browser/payments/iban_save_manager.h"
#include "components/autofill/core/browser/payments/payments_customer_data.h"
#include "components/autofill/core/browser/payments/payments_util.h"
#include "components/autofill/core/browser/payments/test_credit_card_save_manager.h"
#include "components/autofill/core/browser/payments/test_local_card_migration_manager.h"
#include "components/autofill/core/browser/payments/test_payments_autofill_client.h"
#include "components/autofill/core/browser/payments/test_payments_network_interface.h"
#include "components/autofill/core/browser/payments_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_clock.h"
#include "components/autofill/core/browser/test_autofill_driver.h"
#include "components/autofill/core/browser/test_browser_autofill_manager.h"
#include "components/autofill/core/browser/test_form_data_importer.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "components/autofill/core/common/credit_card_network_identifiers.h"
#include "components/autofill/core/common/form_data.h"
#include "components/autofill/core/common/form_data_test_api.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/prefs/pref_service.h"
#include "components/sync/test/test_sync_service.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace autofill {
ASCIIToUTF16;
CreateTestCreditCardFormData;
_;
NiceMock;
class LocalCardMigrationManagerTest : public testing::Test { … };
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseLocalCardWithOneLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseNewCardWithAnyLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseLocalCardWithMoreLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseLocalCardWithInvalidLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseServerCardWithOneValidLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_UseServerCardWithNoneValidLocal) { … }
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_SignInOnly) { … }
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_NoPaymentsAccount) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_LocalCardMatchMaskedServerCard) { … }
TEST_F(LocalCardMigrationManagerTest, GetDetectedValues_AllWithCardHolderName) { … }
TEST_F(LocalCardMigrationManagerTest,
GetDetectedValues_OneCardWithoutCardHolderName) { … }
TEST_F(LocalCardMigrationManagerTest,
GetDetectedValues_IncludeGooglePaymentsAccount) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_ShouldAddMigrateCardsBillableServiceNumberInRequest) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_ShouldAddMigrateCardsBillingCustomerNumberInRequest) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_ShouldAddUploadCardSourceInRequest_CheckoutFlow) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_ShouldAddUploadCardSourceInRequest_SettingsPage) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_TriggerFromSettingsPage) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_TriggerFromSubmittedForm) { … }
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_MigrationSuccess) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_MigrationTemporaryFailure) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_MigrationPermanentFailure) { … }
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_ToggleIsChosen) { … }
TEST_F(LocalCardMigrationManagerTest, DeleteLocalCardViaMigrationDialog) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateLocalCreditCard_MaxStrikesReached) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateServerCreditCard_MaxStrikesReached) { … }
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_StrikeCountUMALogged) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_MigrationAbortWhenUseUnsupportedLocalCard) { … }
TEST_F(LocalCardMigrationManagerTest,
MigrateCreditCard_MigrateWhenHasSupportedLocalCard) { … }
TEST_F(
LocalCardMigrationManagerTest,
MigrateCreditCard_MigrateWhenUseUnsupportedServerCardWithSupportedLocalCard) { … }
TEST_F(
LocalCardMigrationManagerTest,
MigrateCreditCard_MigrateAbortWhenUseSupportedServerCardWithUnsupportedLocalCard) { … }
TEST_F(LocalCardMigrationManagerTest, MigrateCreditCard_GetUploadDetailsFails) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationOrigin_UseLocalCardWithMoreLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationOrigin_UseServerCardWithOneValidLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationOrigin_UseServerCardWithNoneValidLocal) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationOrigin_TriggerFromSettingsPage) { … }
TEST_F(LocalCardMigrationManagerTest, LogMigrationDecisionMetric_UseNewCard) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_FailedEnablementPrerequisites) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_MaxStrikesReached) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_NotOfferedSingleLocalCard) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_NoMigratableCards) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_GetUploadDetailsFails) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_UseUnsupportedLocalCard) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_NoSupportedCardsForSupportedServerCard) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_NoSupportedCardsForUnsupportedServerCard) { … }
TEST_F(LocalCardMigrationManagerTest,
LogMigrationDecisionMetric_MigrationOffered) { … }
TEST_F(LocalCardMigrationManagerTest,
InvalidLegalMessageInOnDidGetUploadDetails) { … }
}