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

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

Issue 2137443002: Revert of [Payments] Update autofill/payments spacings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@payments_ongoing
Patch Set: Created 4 years, 5 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
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/widget/CompatibilityTextInputLayout.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c4cc7355ec39f084ce7b6ab1083b8c1dab2ff253..a117f225ee5949f187331eee87f027620e040b90 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,6 +4,8 @@
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;
@@ -28,7 +30,6 @@
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;
@@ -212,7 +213,15 @@
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- ((Spinner) mUI.getEditorView().findViewById(R.id.spinner)).setSelection(selection);
+ 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;
+ }
+ }
}
});
helper.waitForCallback(callCount);
@@ -225,9 +234,13 @@
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- List<EditorTextField> fields = mUI.getEditorView().getEditorTextFields();
- for (int i = 0; i < values.length; i++) {
- fields.get(i).getEditText().setText(values[i]);
+ 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++]);
+ }
}
}
});
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/widget/CompatibilityTextInputLayout.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698