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

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

Issue 2854973002: [Web Payments] Go to editors directly when "Add" buttons are pressed (Closed)
Patch Set: Fix comments. 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/payment_request_browsertest_base.cc
diff --git a/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc b/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
index 4f0383b58f4779e5bf5c4dbef209ec34fe7c17cc..0840485c4652472458690d543944a3f940e01412 100644
--- a/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
+++ b/chrome/browser/ui/views/payments/payment_request_browsertest_base.cc
@@ -296,19 +296,43 @@ void PaymentRequestBrowserTestBase::OpenContactInfoScreen() {
void PaymentRequestBrowserTestBase::OpenCreditCardEditorScreen() {
ResetEventObserver(DialogEvent::CREDIT_CARD_EDITOR_OPENED);
- ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_CARD_BUTTON);
+ views::View* view = delegate_->dialog_view()->GetViewByID(
+ static_cast<int>(DialogViewID::PAYMENT_METHOD_ADD_CARD_BUTTON));
+ if (!view) {
+ view = delegate_->dialog_view()->GetViewByID(static_cast<int>(
+ DialogViewID::PAYMENT_SHEET_PAYMENT_METHOD_SECTION_BUTTON));
+ }
+
+ EXPECT_TRUE(view);
+ ClickOnDialogViewAndWait(view);
}
void PaymentRequestBrowserTestBase::OpenShippingAddressEditorScreen() {
ResetEventObserver(DialogEvent::SHIPPING_ADDRESS_EDITOR_OPENED);
- ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_SHIPPING_BUTTON);
+ views::View* view = delegate_->dialog_view()->GetViewByID(
+ static_cast<int>(DialogViewID::PAYMENT_METHOD_ADD_SHIPPING_BUTTON));
+ if (!view) {
+ view = delegate_->dialog_view()->GetViewByID(static_cast<int>(
+ DialogViewID::PAYMENT_SHEET_SHIPPING_ADDRESS_SECTION_BUTTON));
+ }
+
+ EXPECT_TRUE(view);
+ ClickOnDialogViewAndWait(view);
}
void PaymentRequestBrowserTestBase::OpenContactInfoEditorScreen() {
ResetEventObserver(DialogEvent::CONTACT_INFO_EDITOR_OPENED);
- ClickOnDialogViewAndWait(DialogViewID::PAYMENT_METHOD_ADD_CONTACT_BUTTON);
+ views::View* view = delegate_->dialog_view()->GetViewByID(
+ static_cast<int>(DialogViewID::PAYMENT_METHOD_ADD_CONTACT_BUTTON));
+ if (!view) {
+ view = delegate_->dialog_view()->GetViewByID(static_cast<int>(
+ DialogViewID::PAYMENT_SHEET_CONTACT_INFO_SECTION_BUTTON));
+ }
+
+ EXPECT_TRUE(view);
+ ClickOnDialogViewAndWait(view);
}
void PaymentRequestBrowserTestBase::ClickOnBackArrow() {

Powered by Google App Engine
This is Rietveld 408576698