| 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 d2f1ea496bbd0ac26f0ff7c8b273ba4f9decce24..7612cd0b4af5a29bd3cba6223448630061d8d807 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
|
| @@ -321,7 +321,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
|
| });
|
| }
|
|
|
| - /** Returns the the number of payment instruments. */
|
| + /** Returns the number of payment instruments. */
|
| protected int getNumberOfPaymentInstruments() throws ExecutionException {
|
| return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
|
| @Override
|
| @@ -332,7 +332,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
|
| });
|
| }
|
|
|
| - /** Returns the the number of contact detail suggestions. */
|
| + /** Returns the number of contact detail suggestions. */
|
| protected int getNumberOfContactDetailSuggestions() throws ExecutionException {
|
| return ThreadUtils.runOnUiThreadBlocking(new Callable<Integer>() {
|
| @Override
|
| @@ -595,6 +595,57 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
|
| });
|
| }
|
|
|
| + /** Will fail if the OptionRow at |index| is not selected in Contact Details.*/
|
| + protected void expectContactDetailsRowIsSelected(final int index)
|
| + throws ExecutionException, InterruptedException {
|
| + CriteriaHelper.pollInstrumentationThread(new Criteria() {
|
| + @Override
|
| + public boolean isSatisfied() {
|
| + boolean isSelected = ((OptionSection) mUI.getContactDetailsSectionForTest())
|
| + .getOptionRowAtIndex(index)
|
| + .isChecked();
|
| + if (!isSelected) {
|
| + updateFailureReason("Contact Details row at " + index + " was not selected.");
|
| + }
|
| + return isSelected;
|
| + }
|
| + });
|
| + }
|
| +
|
| + /** Will fail if the OptionRow at |index| is not selected in Shipping Address section.*/
|
| + protected void expectShippingAddressRowIsSelected(final int index)
|
| + throws ExecutionException, InterruptedException {
|
| + CriteriaHelper.pollInstrumentationThread(new Criteria() {
|
| + @Override
|
| + public boolean isSatisfied() {
|
| + boolean isSelected = ((OptionSection) mUI.getShippingAddressSectionForTest())
|
| + .getOptionRowAtIndex(index)
|
| + .isChecked();
|
| + if (!isSelected) {
|
| + updateFailureReason("Shipping Address row at " + index + " was not selected.");
|
| + }
|
| + return isSelected;
|
| + }
|
| + });
|
| + }
|
| +
|
| + /** Will fail if the OptionRow at |index| is not selected in PaymentMethod section.*/
|
| + protected void expectPaymentMethodRowIsSelected(final int index)
|
| + throws ExecutionException, InterruptedException {
|
| + CriteriaHelper.pollInstrumentationThread(new Criteria() {
|
| + @Override
|
| + public boolean isSatisfied() {
|
| + boolean isSelected = ((OptionSection) mUI.getPaymentMethodSectionForTest())
|
| + .getOptionRowAtIndex(index)
|
| + .isChecked();
|
| + if (!isSelected) {
|
| + updateFailureReason("Payment Method row at " + index + " was not selected.");
|
| + }
|
| + return isSelected;
|
| + }
|
| + });
|
| + }
|
| +
|
| @Override
|
| public void onPaymentRequestReadyForInput(PaymentRequestUI ui) {
|
| ThreadUtils.assertOnUiThread();
|
|
|