Chromium Code Reviews| 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 6b8cb26b084ef814c4762951007c9c9b8b5b1401..6912680b6bcf5981afa5c7cb120f661129cbaec0 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.button_secondary); | 
| + clickPaymentUIView("secondary button", R.id.button_secondary); | 
| } | 
| protected void clickPrimaryPaymentUIButton() throws InterruptedException { | 
| - clickPaymentUIButton("primary", R.id.button_primary); | 
| + clickPaymentUIView("primary button", R.id.button_primary); | 
| } | 
| - private void clickPaymentUIButton(final String buttonName, final int resourceId) | 
| + protected void expandShippingAddressSection() throws InterruptedException { | 
| + clickPaymentUIView("shipping section", R.id.payments_shipping_section); | 
| + } | 
| + | 
| + protected void selectOptionInExpandedSection() throws InterruptedException { | 
| + clickPaymentUIView("option line", R.id.payments_selectable_option); | 
| 
 
gone
2016/05/03 17:28:20
Won't this break if you have multiple selectable o
 
please use gerrit instead
2016/05/03 21:38:33
I am indeed relying on having only one in the inte
 
gone
2016/05/04 02:01:02
Yeah, sounds good.
 
 | 
| + } | 
| + | 
| + 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 = ui.getDialogForTest().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; | 
| } |