#include "components/autofill/core/browser/payments/full_card_request.h"
#include "base/command_line.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/metrics/payments/card_unmask_authentication_metrics.h"
#include "components/autofill/core/browser/payments/payments_autofill_client.h"
#include "components/autofill/core/browser/payments/payments_network_interface.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_driver.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/autofill/core/browser/ui/payments/card_unmask_prompt_options.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/sync/test/test_sync_service.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "net/url_request/url_request_test_util.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/origin.h"
namespace autofill {
namespace payments {
_;
NiceMock;
PaymentsRpcCardType;
PaymentsRpcResult;
class MockResultDelegate : public FullCardRequest::ResultDelegate { … };
class MockUIDelegate : public FullCardRequest::UIDelegate { … };
class MockPaymentsDataManager : public TestPaymentsDataManager { … };
class FullCardRequestTest : public testing::Test { … };
MATCHER_P2(CardMatches, record_type, card_number, "") { … }
MATCHER_P3(CardMatches, record_type, card_number, cvc, "") { … }
MATCHER_P4(CardMatches, record_type, number, month, year, "") { … }
TEST_F(FullCardRequestTest, GetFullCardPanAndCvcForMaskedServerCardViaCvc) { … }
TEST_F(FullCardRequestTest, GetFullCardPanAndDcvvForMaskedServerCardViaDcvv) { … }
TEST_F(FullCardRequestTest, GetFullCardPanAndCvcForMaskedServerCardViaFido) { … }
TEST_F(FullCardRequestTest, GetFullCardPanAndCvcForLocalCard) { … }
TEST_F(FullCardRequestTest, GetFullCardPanAndCvcForExpiredMaskedServerCard) { … }
TEST_F(FullCardRequestTest,
GetFullCardPanAndExpirationAndDcvvForVirtualCardViaCvc) { … }
TEST_F(FullCardRequestTest,
DoesNotIncludeMerchantDomainForFootprintsWhenOffTheRecord) { … }
TEST_F(FullCardRequestTest, OneRequestAtATime) { … }
TEST_F(FullCardRequestTest, SecondRequestOkAfterFirstFinished) { … }
TEST_F(FullCardRequestTest, ClosePromptWithoutUserInput) { … }
TEST_F(FullCardRequestTest, PermanentFailure) { … }
TEST_F(FullCardRequestTest, VcnRetrievalTemporaryFailure) { … }
TEST_F(FullCardRequestTest, VcnRetrievalPermanentFailure) { … }
TEST_F(FullCardRequestTest, NetworkError) { … }
TEST_F(FullCardRequestTest, TryAgainFailureGiveUp) { … }
TEST_F(FullCardRequestTest, ServerCardTryAgainFailure) { … }
TEST_F(FullCardRequestTest, VirtualCardTryAgainFailure) { … }
TEST_F(FullCardRequestTest, UpdateExpDateForMaskedServerCard) { … }
TEST_F(FullCardRequestTest, UpdateExpDateForLocalCard) { … }
TEST_F(FullCardRequestTest, UnmaskForPaymentRequest) { … }
class FullCardRequestCardMetadataTest
: public FullCardRequestTest,
public testing::WithParamInterface<std::tuple<bool, bool, bool>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(FullCardRequestCardMetadataTest, MetadataSignal) { … }
class FullCardRequestCardBenefitsTest
: public FullCardRequestTest,
public ::testing::WithParamInterface<
std::tuple<base::FunctionRef<CreditCardBenefit()>,
bool,
std::string>> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(FullCardRequestCardBenefitsTest, Benefits_ClientBehaviorConstants) { … }
}
}