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 9c3bbac97dfdc05cdb42aba1227e65deb50d8fae..a1fb8ff0cbee0307ee8955a5b3f0fc841e67c113 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 |
| @@ -83,6 +83,15 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT |
| /** The billing address dropdown index for the first billing address. */ |
| protected static final int FIRST_BILLING_ADDRESS = 0; |
| + /** The expiration year dropdown index for the California. */ |
|
sebsg
2017/02/28 16:13:59
expiration year?
Parastoo
2017/03/21 14:30:44
Done.
|
| + protected static final int CA = 8; |
| + |
| + /** The expiration year dropdown index for the California. */ |
|
sebsg
2017/02/28 16:13:59
ditto
Parastoo
2017/03/21 14:30:44
Done.
|
| + protected static final int NY = 42; |
| + |
| + /** The expiration year dropdown index for the United States. */ |
|
sebsg
2017/02/28 16:13:59
ditto
Parastoo
2017/03/21 14:30:44
Done.
|
| + protected static final int US = 236; |
| + |
| protected final PaymentsCallbackHelper<PaymentRequestUI> mReadyForInput; |
| protected final PaymentsCallbackHelper<PaymentRequestUI> mReadyToPay; |
| protected final PaymentsCallbackHelper<PaymentRequestUI> mSelectionChecked; |
| @@ -541,6 +550,22 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT |
| helper.waitForCallback(callCount); |
| } |
| + /** Selects the spinner value in the editor UI for credit cards. */ |
|
sebsg
2017/02/28 16:13:59
For credit cards?
Parastoo
2017/03/21 14:30:44
Done.
|
| + protected void setSpinnerSelectionsInEditorAndWait(final int[] selections, |
| + CallbackHelper helper) throws InterruptedException, TimeoutException { |
| + int callCount = helper.getCallCount(); |
| + ThreadUtils.runOnUiThreadBlocking(new Runnable() { |
| + @Override |
| + public void run() { |
| + List<Spinner> fields = mUI.getEditorView().getDropdownFieldsForTest(); |
| + for (int i = 0; i < selections.length && i < fields.size(); i++) { |
| + fields.get(i).setSelection(selections[i]); |
| + } |
| + } |
| + }); |
| + helper.waitForCallback(callCount); |
| + } |
| + |
| /** Directly sets the text in the editor UI for credit cards. */ |
| protected void setTextInCardEditorAndWait(final String[] values, CallbackHelper helper) |
| throws InterruptedException, TimeoutException { |