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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestTestBase.java

Issue 2680143002: Use dropdown list for admin areas in pr form. (Closed)
Patch Set: Touch ups Created 3 years, 10 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/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 {

Powered by Google App Engine
This is Rietveld 408576698