| 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 a117f225ee5949f187331eee87f027620e040b90..c4cc7355ec39f084ce7b6ab1083b8c1dab2ff253 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
|
| @@ -4,8 +4,6 @@
|
|
|
| package org.chromium.chrome.browser.payments;
|
|
|
| -import android.view.View;
|
| -import android.view.ViewGroup;
|
| import android.widget.EditText;
|
| import android.widget.Spinner;
|
| import android.widget.TextView;
|
| @@ -30,6 +28,7 @@ import org.chromium.content.browser.test.util.CriteriaHelper;
|
| import org.chromium.content.browser.test.util.DOMUtils;
|
| import org.chromium.content_public.browser.WebContents;
|
|
|
| +import java.util.List;
|
| import java.util.concurrent.Callable;
|
| import java.util.concurrent.ExecutionException;
|
| import java.util.concurrent.TimeoutException;
|
| @@ -213,15 +212,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| - ViewGroup contents = (ViewGroup) mUI.getEditorView().findViewById(R.id.contents);
|
| - assertNotNull(contents);
|
| - for (int i = 0; i < contents.getChildCount(); i++) {
|
| - View view = contents.getChildAt(i);
|
| - if (view instanceof Spinner) {
|
| - ((Spinner) view).setSelection(selection);
|
| - return;
|
| - }
|
| - }
|
| + ((Spinner) mUI.getEditorView().findViewById(R.id.spinner)).setSelection(selection);
|
| }
|
| });
|
| helper.waitForCallback(callCount);
|
| @@ -234,13 +225,9 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
|
| ThreadUtils.runOnUiThreadBlocking(new Runnable() {
|
| @Override
|
| public void run() {
|
| - ViewGroup contents = (ViewGroup) mUI.getEditorView().findViewById(R.id.contents);
|
| - assertNotNull(contents);
|
| - for (int i = 0, j = 0; i < contents.getChildCount() && j < values.length; i++) {
|
| - View view = contents.getChildAt(i);
|
| - if (view instanceof EditorTextField) {
|
| - ((EditorTextField) view).getEditText().setText(values[j++]);
|
| - }
|
| + List<EditorTextField> fields = mUI.getEditorView().getEditorTextFields();
|
| + for (int i = 0; i < values.length; i++) {
|
| + fields.get(i).getEditText().setText(values[i]);
|
| }
|
| }
|
| });
|
|
|