Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Unified Diff: components/payments/core/autofill_payment_instrument_unittest.cc

Issue 2849523003: Add billing address as a mandatory field of Payments credit cards. (Closed)
Patch Set: Components Unittests fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/payments/core/autofill_payment_instrument_unittest.cc
diff --git a/components/payments/core/autofill_payment_instrument_unittest.cc b/components/payments/core/autofill_payment_instrument_unittest.cc
index 0c17f1bc8a886e514d8f2bcd97922ddbae4033de..a10c1ecb5af527cc8f78f1f4f5f1eb85ce05f468 100644
--- a/components/payments/core/autofill_payment_instrument_unittest.cc
+++ b/components/payments/core/autofill_payment_instrument_unittest.cc
@@ -135,6 +135,8 @@ TEST_F(AutofillPaymentInstrumentTest,
// A Masked (server) card is a valid instrument for payment.
TEST_F(AutofillPaymentInstrumentTest, IsCompleteForPayment_MaskedCard) {
autofill::CreditCard card = autofill::test::GetMaskedServerCard();
+ ASSERT_GT(billing_profiles().size(), 0UL);
+ card.set_billing_address_id(billing_profiles()[0]->guid());
AutofillPaymentInstrument instrument("visa", card, billing_profiles(),
"en-US", nullptr);
EXPECT_TRUE(instrument.IsCompleteForPayment());
@@ -144,6 +146,8 @@ TEST_F(AutofillPaymentInstrumentTest, IsCompleteForPayment_MaskedCard) {
// An expired masked (server) card is not a valid instrument for payment.
TEST_F(AutofillPaymentInstrumentTest, IsCompleteForPayment_ExpiredMaskedCard) {
autofill::CreditCard card = autofill::test::GetMaskedServerCard();
+ ASSERT_GT(billing_profiles().size(), 0UL);
+ card.set_billing_address_id(billing_profiles()[0]->guid());
card.SetExpirationYear(2016); // Expired.
AutofillPaymentInstrument instrument("visa", card, billing_profiles(),
"en-US", nullptr);

Powered by Google App Engine
This is Rietveld 408576698