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

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

Issue 2733953003: [Payments] Return a basic card response (Closed)
Patch Set: addressed comments from anthony Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_request_browsertest_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/payment_request_browsertest.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_browsertest.cc
index 5cebdacf01c3d101cb601f7bd5defd27fff0870c..d722d6d80236fafd271f83edce10db8ea12b960a 100644
--- a/chrome/browser/ui/views/payments/payment_request_browsertest.cc
+++ b/chrome/browser/ui/views/payments/payment_request_browsertest.cc
@@ -10,6 +10,9 @@
#include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "components/autofill/core/browser/autofill_profile.h"
+#include "components/autofill/core/browser/autofill_test_utils.h"
+#include "components/autofill/core/browser/credit_card.h"
#include "components/payments/content/payment_request.h"
#include "components/payments/content/payment_request_web_contents_manager.h"
#include "components/web_modal/web_contents_modal_dialog_manager.h"
@@ -93,6 +96,38 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, OpenAndReload) {
WaitForObservedEvent();
}
+IN_PROC_BROWSER_TEST_F(PaymentRequestNoShippingTest, PayWithVisa) {
+ autofill::AutofillProfile billing_address = autofill::test::GetFullProfile();
+ AddAutofillProfile(billing_address);
+ autofill::CreditCard card = autofill::test::GetCreditCard();
+ card.set_billing_address_id(billing_address.guid());
+ AddCreditCard(card); // Visa.
+
+ InvokePaymentRequestUI();
+
+ ResetEventObserver(DialogEvent::DIALOG_CLOSED);
+
+ ClickOnDialogViewAndWait(DialogViewID::PAY_BUTTON);
+
+ WaitForObservedEvent();
+
+ // The actual structure of the card response is unit-tested.
+ ExpectBodyContains(std::vector<base::string16>{
+ card.GetRawInfo(autofill::CREDIT_CARD_NUMBER),
+ card.GetRawInfo(autofill::CREDIT_CARD_NAME_FULL),
+ card.GetRawInfo(autofill::CREDIT_CARD_EXP_MONTH),
+ card.GetRawInfo(autofill::CREDIT_CARD_EXP_4_DIGIT_YEAR)});
+ ExpectBodyContains(std::vector<base::string16>{
+ billing_address.GetRawInfo(autofill::NAME_FIRST),
+ billing_address.GetRawInfo(autofill::NAME_LAST),
+ billing_address.GetRawInfo(autofill::ADDRESS_HOME_LINE1),
+ billing_address.GetRawInfo(autofill::ADDRESS_HOME_LINE2),
+ billing_address.GetRawInfo(autofill::ADDRESS_HOME_COUNTRY),
+ billing_address.GetRawInfo(autofill::ADDRESS_HOME_ZIP),
+ billing_address.GetRawInfo(autofill::ADDRESS_HOME_CITY),
+ billing_address.GetRawInfo(autofill::ADDRESS_HOME_STATE)});
+}
+
class PaymentRequestAbortTest : public PaymentRequestBrowserTestBase {
protected:
PaymentRequestAbortTest()
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/payment_request_browsertest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698