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

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

Issue 2866443002: [Web Payments] Handle "Enter" accelerator when there's a primary action (Closed)
Patch Set: Add tests to sheets that handle the enter accelerator 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 7569316004ff2e1cfb76150f540514e57951330b..d6e111ddd8738fc3453634f76f056ab910f63b8e 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
@@ -4,6 +4,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/views/payments/payment_request_browsertest_base.h"
+#include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
namespace payments {
@@ -47,4 +48,22 @@ IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
ExpectBodyContains({"\"cardSecurityCode\": \"012\""});
}
+IN_PROC_BROWSER_TEST_F(PaymentRequestCvcUnmaskViewControllerTest,
+ EnterAcceleratorConfirmsCvc) {
+ AddCreditCard(autofill::test::GetCreditCard()); // Visa.
+
+ InvokePaymentRequestUI();
+ ResetEventObserver(DialogEvent::DIALOG_CLOSED);
+ OpenCVCPromptWithCVC(base::ASCIIToUTF16("012"));
+
+ ResetEventObserver(DialogEvent::DIALOG_CLOSED);
+ views::View* cvc_sheet = dialog_view()->GetViewByID(
+ static_cast<int>(DialogViewID::CVC_UNMASK_SHEET));
+ cvc_sheet->AcceleratorPressed(ui::Accelerator(ui::VKEY_RETURN, ui::EF_NONE));
+ WaitForAnimation();
+ WaitForObservedEvent();
+
+ ExpectBodyContains({"\"cardSecurityCode\": \"012\""});
+}
+
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698