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

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

Issue 2844293002: [Payments] Handle clicking back on the CVC unmask dialog (Closed)
Patch Set: Test Created 3 years, 8 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 068a306612dc7d0ff3f9cc776eea7172c215acfc..7569316004ff2e1cfb76150f540514e57951330b 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
@@ -8,17 +8,19 @@
namespace payments {
-class CvcUnmaskViewControllerTest : public PaymentRequestBrowserTestBase {
+class PaymentRequestCvcUnmaskViewControllerTest
+ : public PaymentRequestBrowserTestBase {
protected:
- CvcUnmaskViewControllerTest()
+ PaymentRequestCvcUnmaskViewControllerTest()
: PaymentRequestBrowserTestBase(
"/payment_request_no_shipping_test.html") {}
private:
- DISALLOW_COPY_AND_ASSIGN(CvcUnmaskViewControllerTest);
+ DISALLOW_COPY_AND_ASSIGN(PaymentRequestCvcUnmaskViewControllerTest);
};
-IN_PROC_BROWSER_TEST_F(CvcUnmaskViewControllerTest, CvcSentToResponse) {
+IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
+ CvcSentToResponse) {
AddCreditCard(autofill::test::GetCreditCard()); // Visa.
InvokePaymentRequestUI();
@@ -28,4 +30,21 @@ IN_PROC_BROWSER_TEST_F(CvcUnmaskViewControllerTest, CvcSentToResponse) {
ExpectBodyContains({"\"cardSecurityCode\": \"012\""});
}
+// Test that going in the CVC editor, backing out and opening it again to pay
+// does not crash.
+IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
+ OpenGoBackOpenPay) {
+ AddCreditCard(autofill::test::GetCreditCard()); // Visa.
+
+ InvokePaymentRequestUI();
+ OpenCVCPromptWithCVC(base::ASCIIToUTF16("012"));
+
+ // Go back before confirming the CVC.
+ ClickOnBackArrow();
+
+ // Now pay for real.
+ PayWithCreditCardAndWait(base::ASCIIToUTF16("012"));
+ ExpectBodyContains({"\"cardSecurityCode\": \"012\""});
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698