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

Unified Diff: chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.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: chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
index a95524e5c2eedf2a9428d8d5cbe9456960a8f24d..a6c10fb93847bbacc40d8317ae3c9dc54a1941e9 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller_browsertest.cc
@@ -24,7 +24,10 @@ class PaymentMethodViewControllerTest : public PaymentRequestBrowserTestBase {
};
IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest, OneCardSelected) {
- const autofill::CreditCard card = autofill::test::GetCreditCard();
+ autofill::AutofillProfile billing_profile(autofill::test::GetFullProfile());
+ PaymentRequestBrowserTestBase::AddAutofillProfile(billing_profile);
+ autofill::CreditCard card = autofill::test::GetCreditCard();
+ card.set_billing_address_id(billing_profile.guid());
AddCreditCard(card);
InvokePaymentRequestUI();
@@ -47,7 +50,12 @@ IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest, OneCardSelected) {
IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest,
OneCardSelectedOutOfMany) {
+ autofill::AutofillProfile billing_profile(autofill::test::GetFullProfile());
+ PaymentRequestBrowserTestBase::AddAutofillProfile(billing_profile);
+
autofill::CreditCard card1 = autofill::test::GetCreditCard();
+ card1.set_billing_address_id(billing_profile.guid());
+
// Ensure that this card is the first suggestion.
card1.set_use_count(5U);
AddCreditCard(card1);
@@ -55,6 +63,7 @@ IN_PROC_BROWSER_TEST_F(PaymentMethodViewControllerTest,
// Slightly different visa.
autofill::CreditCard card2 = autofill::test::GetCreditCard();
card2.SetNumber(base::ASCIIToUTF16("4111111111111112"));
+ card2.set_billing_address_id(billing_profile.guid());
card2.set_use_count(1U);
AddCreditCard(card2);

Powered by Google App Engine
This is Rietveld 408576698