#include "components/autofill/core/browser/payments_data_manager.h"
#include <stddef.h>
#include <list>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/gtest_util.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/time/time.h"
#include "base/uuid.h"
#include "components/autofill/core/browser/autofill_experiments.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/bank_account.h"
#include "components/autofill/core/browser/data_model/credit_card_art_image.h"
#include "components/autofill/core/browser/data_model/credit_card_benefit_test_api.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/form_structure.h"
#include "components/autofill/core/browser/metrics/autofill_metrics.h"
#include "components/autofill/core/browser/metrics/payments/mandatory_reauth_metrics.h"
#include "components/autofill/core/browser/payments_data_manager_test_api.h"
#include "components/autofill/core/browser/payments_data_manager_test_base.h"
#include "components/autofill/core/browser/personal_data_manager_test_utils.h"
#include "components/autofill/core/browser/test_autofill_clock.h"
#include "components/autofill/core/browser/ui/autofill_image_fetcher_base.h"
#include "components/autofill/core/browser/ui/suggestion.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_constants.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/autofill/core/common/credit_card_network_identifiers.h"
#include "components/autofill/core/common/form_data.h"
#include "components/signin/public/base/signin_switches.h"
#include "components/signin/public/identity_manager/account_managed_status_finder.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/user_selectable_type.h"
#include "components/sync/test/test_sync_service.h"
#include "components/version_info/version_info.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/image/image_unittest_util.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif
namespace autofill {
namespace {
Pointee;
const base::Time kArbitraryTime = …;
const base::Time kSomeLaterTime = …;
template <typename T>
bool CompareElements(T* a, T* b) { … }
template <typename T>
bool ElementsEqual(T* a, T* b) { … }
template <typename T>
void ExpectSameElements(const std::vector<T*>& expectations,
const std::vector<T*>& results) { … }
class MockPaymentsDataManagerObserver : public PaymentsDataManager::Observer { … };
}
class PaymentsDataManagerHelper : public PaymentsDataManagerTestBase { … };
class MockAutofillImageFetcher : public AutofillImageFetcherBase { … };
class PaymentsDataManagerTest : public PaymentsDataManagerHelper,
public testing::Test { … };
class PaymentsDataManagerSyncTransportModeTest
: public PaymentsDataManagerHelper,
public testing::Test { … };
TEST_F(PaymentsDataManagerTest, AddAndReloadServerIbans) { … }
TEST_F(PaymentsDataManagerTest, GetIbans) { … }
TEST_F(PaymentsDataManagerTest,
GetIbansToSuggestRemovesLocalIbanThatMatchesServerIban) { … }
TEST_F(PaymentsDataManagerTest, GetIbansToSuggestOrdersByFrecency) { … }
TEST_F(PaymentsDataManagerTest, AddLocalIbans) { … }
TEST_F(PaymentsDataManagerTest, NoIbansAddedIfDisabled) { … }
TEST_F(PaymentsDataManagerTest, AddingIbanUpdatesPref) { … }
TEST_F(PaymentsDataManagerTest, UpdateLocalIbans) { … }
TEST_F(PaymentsDataManagerTest, RemoveLocalIbans) { … }
TEST_F(PaymentsDataManagerTest, RecordIbanUsage_LocalIban) { … }
TEST_F(PaymentsDataManagerTest, RecordIbanUsage_ServerIban) { … }
TEST_F(PaymentsDataManagerTest, AddUpdateRemoveCreditCards) { … }
TEST_F(PaymentsDataManagerTest, RecordUseOfCard) { … }
TEST_F(PaymentsDataManagerTest, UpdateLocalCvc) { … }
TEST_F(PaymentsDataManagerTest, ServerCvc) { … }
TEST_F(PaymentsDataManagerTest, ClearServerCvc) { … }
TEST_F(PaymentsDataManagerTest, AddCreditCard_BasicInformation) { … }
TEST_F(PaymentsDataManagerTest, AddCreditCard_CrazyCharacters) { … }
TEST_F(PaymentsDataManagerTest, AddCreditCard_Invalid) { … }
TEST_F(PaymentsDataManagerTest, GetCreditCardByServerId) { … }
TEST_F(PaymentsDataManagerTest, UpdateUnverifiedCreditCards) { … }
TEST_F(PaymentsDataManagerTest, SetUniqueCreditCardLabels) { … }
TEST_F(PaymentsDataManagerTest, SetEmptyCreditCard) { … }
TEST_F(PaymentsDataManagerTest, GetAutofillOffers) { … }
TEST_F(PaymentsDataManagerTest, GetActiveAutofillPromoCodeOffersForOrigin) { … }
TEST_F(PaymentsDataManagerTest, GetAutofillOffers_WalletImportDisabled) { … }
TEST_F(PaymentsDataManagerTest, GetAutofillOffers_AutofillCreditCardDisabled) { … }
TEST_F(PaymentsDataManagerTest,
GetActiveAutofillPromoCodeOffersForOrigin_WalletImportDisabled) { … }
TEST_F(PaymentsDataManagerTest,
GetActiveAutofillPromoCodeOffersForOrigin_AutofillCreditCardDisabled) { … }
TEST_F(PaymentsDataManagerTest, GetCreditCardsToSuggest_LocalCardsRanking) { … }
TEST_F(PaymentsDataManagerTest,
GetCreditCardsToSuggest_LocalAndServerCardsRanking) { … }
TEST_F(PaymentsDataManagerTest,
GetCreditCardsToSuggest_CreditCardAutofillDisabled) { … }
TEST_F(PaymentsDataManagerTest,
GetCreditCardsToSuggest_NoCardsLoadedIfDisabled) { … }
TEST_F(PaymentsDataManagerTest,
GetCreditCardsToSuggest_NoCreditCardsAddedIfDisabled) { … }
TEST_F(PaymentsDataManagerTest, DedupeCreditCardToSuggest_MaskedIsKept) { … }
TEST_F(PaymentsDataManagerTest, DedupeCreditCardToSuggest_DifferentCards) { … }
TEST_F(PaymentsDataManagerTest, DeleteLocalCreditCards) { … }
TEST_F(PaymentsDataManagerTest, DeleteAllLocalCreditCards) { … }
TEST_F(PaymentsDataManagerTest, LogStoredCreditCardMetrics) { … }
TEST_F(PaymentsDataManagerTest, GetCreditCards_NoSyncService) { … }
TEST_F(PaymentsDataManagerTest, UsePersistentServerStorage) { … }
TEST_F(PaymentsDataManagerSyncTransportModeTest, SwitchServerStorages) { … }
TEST_F(PaymentsDataManagerSyncTransportModeTest,
UseCorrectStorageForDifferentCards) { … }
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || \
BUILDFLAG(IS_CHROMEOS)
TEST_F(PaymentsDataManagerSyncTransportModeTest,
ServerCardsShowInTransportMode) { … }
TEST_F(PaymentsDataManagerSyncTransportModeTest,
ServerCardsShowInTransportMode_NeedOptIn) { … }
#endif
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(PaymentsDataManagerTest, KeepExistingLocalDataOnSignIn) { … }
#endif
TEST_F(
PaymentsDataManagerTest,
SyncServiceInitializedWithAutofillDisabled_ClearCreditCardNonSettingsOrigins) { … }
TEST_F(PaymentsDataManagerTest, ClearAllCvcs) { … }
TEST_F(PaymentsDataManagerTest, GetActiveCreditCardBenefits) { … }
TEST_F(PaymentsDataManagerTest, GetInactiveCreditCardBenefits) { … }
TEST_F(PaymentsDataManagerTest, GetExpiredCreditCardBenefits) { … }
#if BUILDFLAG(IS_ANDROID)
TEST_F(PaymentsDataManagerTest, HasMaskedBankAccounts_ExpOff) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(
features::kAutofillEnableSyncingOfPixBankAccounts);
BankAccount bank_account1 = test::CreatePixBankAccount(1234L);
BankAccount bank_account2 = test::CreatePixBankAccount(5678L);
ASSERT_TRUE(GetServerDataTable()->SetMaskedBankAccounts(
{bank_account1, bank_account2}));
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
EXPECT_FALSE(payments_data_manager().HasMaskedBankAccounts());
}
TEST_F(PaymentsDataManagerTest, HasMaskedBankAccounts_PaymentMethodsDisabled) {
base::test::ScopedFeatureList scoped_feature_list(
features::kAutofillEnableSyncingOfPixBankAccounts);
BankAccount bank_account1 = test::CreatePixBankAccount(1234L);
BankAccount bank_account2 = test::CreatePixBankAccount(5678L);
ASSERT_TRUE(GetServerDataTable()->SetMaskedBankAccounts(
{bank_account1, bank_account2}));
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
prefs::SetAutofillPaymentMethodsEnabled(prefs_.get(), false);
EXPECT_FALSE(payments_data_manager().HasMaskedBankAccounts());
}
TEST_F(PaymentsDataManagerTest, HasMaskedBankAccounts_NoMaskedBankAccounts) {
base::test::ScopedFeatureList scoped_feature_list(
features::kAutofillEnableSyncingOfPixBankAccounts);
EXPECT_FALSE(payments_data_manager().HasMaskedBankAccounts());
}
TEST_F(PaymentsDataManagerTest, HasMaskedBankAccounts_MaskedBankAccountsExist) {
base::test::ScopedFeatureList scoped_feature_list(
features::kAutofillEnableSyncingOfPixBankAccounts);
BankAccount bank_account1 = test::CreatePixBankAccount(1234L);
BankAccount bank_account2 = test::CreatePixBankAccount(5678L);
ASSERT_TRUE(GetServerDataTable()->SetMaskedBankAccounts(
{bank_account1, bank_account2}));
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
EXPECT_TRUE(payments_data_manager().HasMaskedBankAccounts());
}
TEST_F(PaymentsDataManagerTest, GetMaskedBankAccounts_ExpOff) {
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitAndDisableFeature(
features::kAutofillEnableSyncingOfPixBankAccounts);
BankAccount bank_account1 = test::CreatePixBankAccount(1234L);
BankAccount bank_account2 = test::CreatePixBankAccount(5678L);
ASSERT_TRUE(GetServerDataTable()->SetMaskedBankAccounts(
{bank_account1, bank_account2}));
base::span<const BankAccount> bank_accounts =
payments_data_manager().GetMaskedBankAccounts();
EXPECT_EQ(0u, bank_accounts.size());
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
bank_accounts = payments_data_manager().GetMaskedBankAccounts();
EXPECT_EQ(0u, bank_accounts.size());
}
TEST_F(PaymentsDataManagerTest, GetMaskedBankAccounts_PaymentMethodsDisabled) {
base::test::ScopedFeatureList scoped_feature_list(
features::kAutofillEnableSyncingOfPixBankAccounts);
BankAccount bank_account1 = test::CreatePixBankAccount(1234L);
BankAccount bank_account2 = test::CreatePixBankAccount(5678L);
ASSERT_TRUE(GetServerDataTable()->SetMaskedBankAccounts(
{bank_account1, bank_account2}));
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
prefs::SetAutofillPaymentMethodsEnabled(prefs_.get(), false);
EXPECT_THAT(payments_data_manager().GetMaskedBankAccounts(),
testing::IsEmpty());
}
TEST_F(PaymentsDataManagerTest, GetMaskedBankAccounts_DatabaseUpdated) {
base::test::ScopedFeatureList scoped_feature_list(
features::kAutofillEnableSyncingOfPixBankAccounts);
BankAccount bank_account1 = test::CreatePixBankAccount(1234L);
BankAccount bank_account2 = test::CreatePixBankAccount(5678L);
ASSERT_TRUE(GetServerDataTable()->SetMaskedBankAccounts(
{bank_account1, bank_account2}));
base::span<const BankAccount> bank_accounts =
payments_data_manager().GetMaskedBankAccounts();
EXPECT_EQ(0u, bank_accounts.size());
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
bank_accounts = payments_data_manager().GetMaskedBankAccounts();
EXPECT_EQ(2u, bank_accounts.size());
}
TEST_F(PaymentsDataManagerTest,
MaskedBankAccountsIconsFetched_DatabaseUpdated) {
base::test::ScopedFeatureList scoped_feature_list(
features::kAutofillEnableSyncingOfPixBankAccounts);
MockAutofillImageFetcher mock_image_fetcher;
test_api(payments_data_manager()).SetImageFetcher(&mock_image_fetcher);
BankAccount bank_account1(1234L, u"nickname", GURL("http://www.example1.com"),
u"bank_name", u"account_number",
BankAccount::AccountType::kChecking);
BankAccount bank_account2(5678L, u"nickname", GURL("http://www.example2.com"),
u"bank_name", u"account_number",
BankAccount::AccountType::kChecking);
ASSERT_TRUE(GetServerDataTable()->SetMaskedBankAccounts(
{bank_account1, bank_account2}));
EXPECT_CALL(mock_image_fetcher, FetchImagesForURLs);
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
}
#endif
TEST_F(PaymentsDataManagerTest,
OnBenefitsPrefChange_PrefIsOn_LoadsCardBenefits) { … }
TEST_F(PaymentsDataManagerTest,
OnAutofillPaymentsCardBenefitsPrefChange_PrefIsOff_ClearsCardBenefits) { … }
TEST_F(PaymentsDataManagerTest,
OnAutofillPaymentsCardBenefits_PrefIsOff_BenefitsAreNotReturned) { … }
TEST_F(PaymentsDataManagerTest,
OnAutofillPaymentsCardBenefits_SyncFlagIsOff_BenefitsAreNotReturned) { … }
#if !BUILDFLAG(IS_IOS)
TEST_F(PaymentsDataManagerTest, AddAndGetCreditCardArtImage) { … }
TEST_F(PaymentsDataManagerTest,
TestNoImageFetchingAttemptForCardsWithInvalidCardArtUrls) { … }
TEST_F(PaymentsDataManagerTest, ProcessCardArtUrlChanges) { … }
#endif
class PaymentsDataManagerStartupBenefitsTest
: public PaymentsDataManagerHelper,
public testing::Test,
public testing::WithParamInterface<std::tuple<bool, bool, bool>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(PaymentsDataManagerStartupBenefitsTest,
LogIsCreditCardBenefitsEnabledAtStartup) { … }
TEST_F(PaymentsDataManagerTest,
LogIsCreditCardBenefitsEnabledAtStartup_PaymentMethodsDisabled) { … }
TEST_F(PaymentsDataManagerTest,
LogIsCreditCardBenefitsEnabledAtStartup_NullPrefService) { … }
TEST_F(PaymentsDataManagerTest, OnAcceptedLocalCreditCardSaveWithVerifiedData) { … }
TEST_F(PaymentsDataManagerTest, OnAcceptedLocalIbanSave) { … }
TEST_F(PaymentsDataManagerTest, IsKnownCard_MatchesMaskedServerCard) { … }
TEST_F(PaymentsDataManagerTest, IsKnownCard_MatchesLocalCard) { … }
TEST_F(PaymentsDataManagerTest, IsKnownCard_TypeDoesNotMatch) { … }
TEST_F(PaymentsDataManagerTest, IsKnownCard_LastFourDoesNotMatch) { … }
TEST_F(PaymentsDataManagerTest, IsServerCard_DuplicateOfMaskedServerCard) { … }
TEST_F(PaymentsDataManagerTest, IsServerCard_AlreadyServerCard) { … }
TEST_F(PaymentsDataManagerTest, IsServerCard_UniqueLocalCard) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(PaymentsDataManagerSyncTransportModeTest,
ShouldShowCardsFromAccountOption_FlagOff) { … }
TEST_F(PaymentsDataManagerSyncTransportModeTest,
ShouldShowCardsFromAccountOption_FlagOn) { … }
TEST_F(PaymentsDataManagerSyncTransportModeTest,
ShouldSuggestServerPaymentMethods_FlagOff) { … }
TEST_F(PaymentsDataManagerSyncTransportModeTest,
ShouldSuggestServerPaymentMethods_FlagOn) { … }
#else
TEST_F(PaymentsDataManagerSyncTransportModeTest,
ShouldShowCardsFromAccountOption) {
std::vector<CreditCard> server_cards;
server_cards.emplace_back(CreditCard::RecordType::kMaskedServerCard, "c789");
test::SetCreditCardInfo(&server_cards.back(), "Clyde Barrow",
"0005" , "04", "2999", "1");
server_cards.back().SetNetworkForMaskedCard(kMasterCard);
SetServerCards(server_cards);
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
CoreAccountId account_id =
identity_test_env_.identity_manager()->GetPrimaryAccountId(
signin::ConsentLevel::kSignin);
::autofill::prefs::SetUserOptedInWalletSyncTransport(prefs_.get(), account_id,
true);
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
::autofill::prefs::SetUserOptedInWalletSyncTransport(prefs_.get(), account_id,
false);
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
SetServerCards({});
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
SetServerCards(server_cards);
payments_data_manager().Refresh();
WaitForOnPaymentsDataChanged();
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
sync_service_.SetSignedIn(signin::ConsentLevel::kSync);
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
sync_service_.SetSignedIn(signin::ConsentLevel::kSignin);
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
payments_data_manager().SetSyncServiceForTest(nullptr);
EXPECT_FALSE(payments_data_manager().ShouldShowCardsFromAccountOption());
}
#endif
TEST_F(PaymentsDataManagerSyncTransportModeTest,
GetPaymentsSigninStateForMetrics) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
TEST_F(PaymentsDataManagerSyncTransportModeTest, OnUserAcceptedUpstreamOffer) { … }
#endif
#if BUILDFLAG(IS_ANDROID)
TEST_F(PaymentsDataManagerTest,
AutofillPaymentMethodsMandatoryReauthAlwaysEnabledOnAutomotive) {
if (!base::android::BuildInfo::GetInstance()->is_automotive()) {
GTEST_SKIP() << "This test should only run on automotive.";
}
EXPECT_TRUE(payments_data_manager().IsPaymentMethodsMandatoryReauthEnabled());
EXPECT_CHECK_DEATH_WITH(
{
payments_data_manager().SetPaymentMethodsMandatoryReauthEnabled(false);
},
"This feature should not be able to be turned off on automotive "
"devices.");
EXPECT_TRUE(payments_data_manager().IsPaymentMethodsMandatoryReauthEnabled());
}
#endif
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
TEST_F(PaymentsDataManagerTest, AutofillPaymentMethodsMandatoryReauthEnabled) {
#if BUILDFLAG(IS_ANDROID)
if (base::android::BuildInfo::GetInstance()->is_automotive()) {
GTEST_SKIP() << "This test should not run on automotive.";
}
#endif
EXPECT_FALSE(
payments_data_manager().IsPaymentMethodsMandatoryReauthEnabled());
payments_data_manager().SetPaymentMethodsMandatoryReauthEnabled(true);
EXPECT_TRUE(payments_data_manager().IsPaymentMethodsMandatoryReauthEnabled());
payments_data_manager().SetPaymentMethodsMandatoryReauthEnabled(false);
EXPECT_FALSE(
payments_data_manager().IsPaymentMethodsMandatoryReauthEnabled());
}
TEST_F(
PaymentsDataManagerTest,
ShouldShowPaymentMethodsMandatoryReauthPromo_MaxValueForPromoShownCounterReached) {
#if BUILDFLAG(IS_ANDROID)
if (base::android::BuildInfo::GetInstance()->is_automotive()) {
GTEST_SKIP() << "This test should not run on automotive.";
}
#endif
base::HistogramTester histogram_tester;
for (int i = 0; i < prefs::kMaxValueForMandatoryReauthPromoShownCounter;
i++) {
EXPECT_TRUE(
payments_data_manager().ShouldShowPaymentMethodsMandatoryReauthPromo());
payments_data_manager()
.IncrementPaymentMethodsMandatoryReauthPromoShownCounter();
}
EXPECT_FALSE(
payments_data_manager().ShouldShowPaymentMethodsMandatoryReauthPromo());
histogram_tester.ExpectUniqueSample(
"Autofill.PaymentMethods.MandatoryReauth.CheckoutFlow."
"ReauthOfferOptInDecision2",
autofill_metrics::MandatoryReauthOfferOptInDecision::
kBlockedByStrikeDatabase,
1);
}
TEST_F(PaymentsDataManagerTest,
ShouldShowPaymentMethodsMandatoryReauthPromo_UserOptedInAlready) {
#if BUILDFLAG(IS_ANDROID)
if (base::android::BuildInfo::GetInstance()->is_automotive()) {
GTEST_SKIP() << "This test should not run on automotive.";
}
#endif
base::HistogramTester histogram_tester;
payments_data_manager().SetPaymentMethodsMandatoryReauthEnabled(true);
EXPECT_FALSE(
payments_data_manager().ShouldShowPaymentMethodsMandatoryReauthPromo());
histogram_tester.ExpectUniqueSample(
"Autofill.PaymentMethods.MandatoryReauth.CheckoutFlow."
"ReauthOfferOptInDecision2",
autofill_metrics::MandatoryReauthOfferOptInDecision::kAlreadyOptedIn, 1);
}
TEST_F(PaymentsDataManagerTest,
ShouldShowPaymentMethodsMandatoryReauthPromo_UserOptedOut) {
#if BUILDFLAG(IS_ANDROID)
if (base::android::BuildInfo::GetInstance()->is_automotive()) {
GTEST_SKIP() << "This test should not run on automotive.";
}
#endif
base::HistogramTester histogram_tester;
payments_data_manager().SetPaymentMethodsMandatoryReauthEnabled(false);
EXPECT_FALSE(
payments_data_manager().ShouldShowPaymentMethodsMandatoryReauthPromo());
histogram_tester.ExpectUniqueSample(
"Autofill.PaymentMethods.MandatoryReauth.CheckoutFlow."
"ReauthOfferOptInDecision2",
autofill_metrics::MandatoryReauthOfferOptInDecision::kAlreadyOptedOut, 1);
}
#endif
TEST_F(PaymentsDataManagerTest, SaveCardLocallyIfNewWithNewCard) { … }
TEST_F(PaymentsDataManagerTest, SaveCardLocallyIfNewWithExistingCard) { … }
TEST_F(PaymentsDataManagerTest, GetAccountInfoForPaymentsServer) { … }
TEST_F(PaymentsDataManagerTest, OnAccountsCookieDeletedByUserAction) { … }
}