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

Unified Diff: chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc

Issue 2849523003: Add billing address as a mandatory field of Payments credit cards. (Closed)
Patch Set: Merge branch 'master' into billing 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/cvc_unmask_view_controller_browsertest.cc
diff --git a/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc b/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc
index d6e111ddd8738fc3453634f76f056ab910f63b8e..ca451400466348252eee7cacfc1be1d4e67066d1 100644
--- a/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc
+++ b/chrome/browser/ui/views/payments/cvc_unmask_view_controller_browsertest.cc
@@ -22,7 +22,11 @@ class PaymentRequestCvcUnmaskViewControllerTest
IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
CvcSentToResponse) {
- AddCreditCard(autofill::test::GetCreditCard()); // Visa.
+ autofill::AutofillProfile profile(autofill::test::GetFullProfile());
+ AddAutofillProfile(profile);
+ autofill::CreditCard card(autofill::test::GetCreditCard()); // Visa card.
+ card.set_billing_address_id(profile.guid());
+ AddCreditCard(card);
InvokePaymentRequestUI();
ResetEventObserver(DialogEvent::DIALOG_CLOSED);
@@ -35,7 +39,11 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
// does not crash.
IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
OpenGoBackOpenPay) {
- AddCreditCard(autofill::test::GetCreditCard()); // Visa.
+ autofill::AutofillProfile profile(autofill::test::GetFullProfile());
+ AddAutofillProfile(profile);
+ autofill::CreditCard card(autofill::test::GetCreditCard()); // Visa card.
+ card.set_billing_address_id(profile.guid());
+ AddCreditCard(card);
InvokePaymentRequestUI();
OpenCVCPromptWithCVC(base::ASCIIToUTF16("012"));
@@ -50,10 +58,19 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
EnterAcceleratorConfirmsCvc) {
- AddCreditCard(autofill::test::GetCreditCard()); // Visa.
+ autofill::AutofillProfile profile(autofill::test::GetFullProfile());
+ AddAutofillProfile(profile);
+ autofill::CreditCard card(autofill::test::GetCreditCard()); // Visa card.
+ card.set_billing_address_id(profile.guid());
+ AddCreditCard(card);
InvokePaymentRequestUI();
+
ResetEventObserver(DialogEvent::DIALOG_CLOSED);
+ // This prevents a timeout in error cases where PAY_BUTTON is disabled.
+ ASSERT_TRUE(dialog_view()
+ ->GetViewByID(static_cast<int>(DialogViewID::PAY_BUTTON))
+ ->enabled());
OpenCVCPromptWithCVC(base::ASCIIToUTF16("012"));
ResetEventObserver(DialogEvent::DIALOG_CLOSED);

Powered by Google App Engine
This is Rietveld 408576698