| Index: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
|
| index 8b1157e40a76c81b4195c1f2c93ac0fef145c6d6..03fa2675d82af849b6a85486144e51ef1febea8b 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java
|
| @@ -66,18 +66,26 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
|
| }
|
|
|
| protected void clickClosePaymentUIButton() throws InterruptedException {
|
| - clickPaymentUIButton("close", R.id.close_button);
|
| + clickPaymentUIView("close button", R.id.close_button);
|
| }
|
|
|
| protected void clickSecondaryPaymentUIButton() throws InterruptedException {
|
| - clickPaymentUIButton("secondary", R.id.editButton);
|
| + clickPaymentUIView("secondary button", R.id.editButton);
|
| }
|
|
|
| protected void clickPrimaryPaymentUIButton() throws InterruptedException {
|
| - clickPaymentUIButton("primary", R.id.payButton);
|
| + clickPaymentUIView("primary button", R.id.payButton);
|
| }
|
|
|
| - private void clickPaymentUIButton(final String buttonName, final int resourceId)
|
| + protected void expandShippingAddressSection() throws InterruptedException {
|
| + clickPaymentUIView("shipping section", R.id.shippingSummaryLabel);
|
| + }
|
| +
|
| + protected void selectOptionInExpandedSection() throws InterruptedException {
|
| + clickPaymentUIView("option line", R.id.paymentOptionLine);
|
| + }
|
| +
|
| + private void clickPaymentUIView(final String viewName, final int resourceId)
|
| throws InterruptedException {
|
| CriteriaHelper.pollUiThread(new Criteria() {
|
| @Override
|
| @@ -91,13 +99,13 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
|
| View button = dialog.findViewById(resourceId);
|
| if (button == null) {
|
| updateFailureReason(
|
| - String.format("Cannot find the %s button on payment UI", buttonName));
|
| + String.format("Cannot find the %s on payment UI", viewName));
|
| return false;
|
| }
|
|
|
| if (!button.isEnabled()) {
|
| updateFailureReason(
|
| - String.format("The %s button on payment UI is disabled", buttonName));
|
| + String.format("The %s on payment UI is disabled", viewName));
|
| return false;
|
| }
|
|
|
|
|