#include "components/autofill/core/browser/webdata/payments/payments_autofill_table.h"
#include <map>
#include <memory>
#include <set>
#include <string>
#include <string_view>
#include <utility>
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.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/autofill_type.h"
#include "components/autofill/core/browser/data_model/autofill_offer_data.h"
#include "components/autofill/core/browser/data_model/autofill_wallet_usage_data.h"
#include "components/autofill/core/browser/data_model/bank_account.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/data_model/credit_card_benefit_test_api.h"
#include "components/autofill/core/browser/data_model/credit_card_cloud_token_data.h"
#include "components/autofill/core/browser/data_model/payments_metadata.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/payments/payments_customer_data.h"
#include "components/autofill/core/browser/webdata/autofill_change.h"
#include "components/autofill/core/common/autofill_constants.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_switches.h"
#include "components/autofill/core/common/autofill_util.h"
#include "components/autofill/core/common/credit_card_network_identifiers.h"
#include "components/os_crypt/sync/os_crypt_mocker.h"
#include "components/sync/protocol/autofill_specifics.pb.h"
#include "components/webdata/common/web_database.h"
#include "sql/statement.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/origin.h"
Time;
ElementsAre;
UnorderedElementsAre;
namespace autofill {
namespace {
CreditCardBenefitBase::BenefitId get_benefit_id(
const CreditCardBenefit& benefit) { … }
class PaymentsAutofillTableTest : public testing::Test { … };
TEST_F(PaymentsAutofillTableTest, Iban) { … }
TEST_F(PaymentsAutofillTableTest, MaskedServerIban) { … }
TEST_F(PaymentsAutofillTableTest, MaskedServerIbanMetadataNotUpdated) { … }
TEST_F(PaymentsAutofillTableTest, CreditCard) { … }
TEST_F(PaymentsAutofillTableTest, AddCreditCardCvcWithFlagOff) { … }
TEST_F(PaymentsAutofillTableTest, CreditCardCvc) { … }
TEST_F(PaymentsAutofillTableTest, UpdateCreditCardCvc_Add) { … }
TEST_F(PaymentsAutofillTableTest, UpdateCreditCardCvc_Update) { … }
TEST_F(PaymentsAutofillTableTest, UpdateCreditCardCvc_Delete) { … }
TEST_F(PaymentsAutofillTableTest, LocalCvcs_ClearAll) { … }
TEST_F(PaymentsAutofillTableTest, ServerCvc) { … }
TEST_F(PaymentsAutofillTableTest, ReconcileServerCvcs) { … }
TEST_F(PaymentsAutofillTableTest, AddServerCreditCardForTesting) { … }
TEST_F(PaymentsAutofillTableTest, UpdateCreditCard) { … }
TEST_F(PaymentsAutofillTableTest, UpdateCreditCardOriginOnly) { … }
TEST_F(PaymentsAutofillTableTest, RemoveAutofillDataModifiedBetween) { … }
TEST_F(PaymentsAutofillTableTest, RemoveOriginURLsModifiedBetween) { … }
TEST_F(PaymentsAutofillTableTest, SetGetServerCards) { … }
TEST_F(PaymentsAutofillTableTest, SetGetRemoveServerCardMetadata) { … }
TEST_F(PaymentsAutofillTableTest, SetGetRemoveServerIbanMetadata) { … }
TEST_F(PaymentsAutofillTableTest, AddUpdateServerCardMetadata) { … }
TEST_F(PaymentsAutofillTableTest, UpdateServerCardMetadataDoesNotChangeData) { … }
TEST_F(PaymentsAutofillTableTest, UpdateServerIbanMetadata) { … }
TEST_F(PaymentsAutofillTableTest, RemoveWrongServerCardMetadata) { … }
TEST_F(PaymentsAutofillTableTest, SetServerCardsData) { … }
TEST_F(PaymentsAutofillTableTest, SetServerCardsData_ExistingMetadata) { … }
TEST_F(PaymentsAutofillTableTest, SetServerCardModify) { … }
TEST_F(PaymentsAutofillTableTest, SetServerCardUpdateUsageStatsAndBillingAddress) { … }
TEST_F(PaymentsAutofillTableTest, SetGetPaymentsCustomerData) { … }
TEST_F(PaymentsAutofillTableTest, GetPaymentsCustomerData_NoData) { … }
TEST_F(PaymentsAutofillTableTest, SetGetPaymentsCustomerData_MultipleSet) { … }
TEST_F(PaymentsAutofillTableTest, SetGetCreditCardCloudData_OneTimeSet) { … }
TEST_F(PaymentsAutofillTableTest, SetGetCreditCardCloudData_MultipleSet) { … }
TEST_F(PaymentsAutofillTableTest, GetCreditCardCloudData_NoData) { … }
TEST_F(PaymentsAutofillTableTest, SetAndGetCreditCardOfferData) { … }
TEST_F(PaymentsAutofillTableTest, SetAndGetVirtualCardUsageData) { … }
TEST_F(PaymentsAutofillTableTest, AddUpdateRemoveVirtualCardUsageData) { … }
TEST_F(PaymentsAutofillTableTest, RemoveAllVirtualCardUsageData) { … }
TEST_F(PaymentsAutofillTableTest, GetMaskedBankAccounts) { … }
TEST_F(PaymentsAutofillTableTest,
GetMaskedBankAccounts_BankAccountTypeOutOfBounds) { … }
TEST_F(PaymentsAutofillTableTest, SetMaskedBankAccounts) { … }
TEST_F(PaymentsAutofillTableTest, GetAllCreditCardBenefits) { … }
TEST_F(PaymentsAutofillTableTest, AddInactiveCreditCardBenefit) { … }
TEST_F(PaymentsAutofillTableTest, AddInvalidCreditCardBenefit) { … }
TEST_F(PaymentsAutofillTableTest, ClearCreditCardBenefits) { … }
TEST_F(PaymentsAutofillTableTest, GetCreditCardBenefitsForInstrumentId) { … }
TEST_F(PaymentsAutofillTableTest,
PaymentInstrument_StoresPaymentInstrumentWithBankAccount) { … }
TEST_F(PaymentsAutofillTableTest,
PaymentInstrument_StoresPaymentInstrumentWithIban) { … }
TEST_F(PaymentsAutofillTableTest,
PaymentInstrument_StoresMultiplePaymentInstruments) { … }
TEST_F(PaymentsAutofillTableTest,
PaymentInstrument_SetPaymentInstrumentsOverwritesExistingValues) { … }
}
}