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

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

Issue 2162493002: Revert of Credit card editor for PaymentRequest UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
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 af9daa4d794beae660557c2512dfa9b34cff5f6f..2444005c8c58698092987572a9b3c28ccaeb72b5 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,9 +4,6 @@
package org.chromium.chrome.browser.payments;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
@@ -57,7 +54,6 @@
protected final CallbackHelper mEditorDismissed;
protected final CallbackHelper mDismissed;
protected final CallbackHelper mUnableToAbort;
- protected final CallbackHelper mBillingAddressChangeProcessed;
private final AtomicReference<ContentViewCore> mViewCoreRef;
private final AtomicReference<WebContents> mWebContentsRef;
private final String mTestFilePath;
@@ -78,7 +74,6 @@
mEditorDismissed = new CallbackHelper();
mDismissed = new CallbackHelper();
mUnableToAbort = new CallbackHelper();
- mBillingAddressChangeProcessed = new CallbackHelper();
mViewCoreRef = new AtomicReference<>();
mWebContentsRef = new AtomicReference<>();
mTestFilePath = UrlUtils.getIsolatedTestFilePath(
@@ -161,19 +156,6 @@
helper.waitForCallback(callCount);
}
- /** Clicks on an element in the "Payment" section of the payments UI. */
- protected void clickInPaymentMethodAndWait(final int resourceId, CallbackHelper helper)
- throws InterruptedException, TimeoutException {
- int callCount = helper.getCallCount();
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- mUI.getPaymentMethodSectionForTest().findViewById(resourceId).performClick();
- }
- });
- helper.waitForCallback(callCount);
- }
-
/** Clicks on an element in the "Contact Info" section of the payments UI. */
protected void clickInContactInfoAndWait(final int resourceId, CallbackHelper helper)
throws InterruptedException, TimeoutException {
@@ -182,19 +164,6 @@
@Override
public void run() {
mUI.getContactDetailsSectionForTest().findViewById(resourceId).performClick();
- }
- });
- helper.waitForCallback(callCount);
- }
-
- /** Clicks on an element in the editor UI for credit cards. */
- protected void clickInCardEditorAndWait(final int resourceId, CallbackHelper helper)
- throws InterruptedException, TimeoutException {
- int callCount = helper.getCallCount();
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- mUI.getCardEditorView().findViewById(resourceId).performClick();
}
});
helper.waitForCallback(callCount);
@@ -297,51 +266,14 @@
});
}
- /** Selects the spinner value in the editor UI for credit cards. */
- protected void setSpinnerSelectionsInCardEditorAndWait(final int[] selections,
- CallbackHelper helper) throws InterruptedException, TimeoutException {
- int callCount = helper.getCallCount();
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- List<Spinner> fields = mUI.getCardEditorView().getDropdownFieldsForTest();
- for (int i = 0; i < selections.length && i < fields.size(); i++) {
- fields.get(i).setSelection(selections[i]);
- }
- }
- });
- helper.waitForCallback(callCount);
- }
-
/** Selects the spinner value in the editor UI. */
- protected void setSpinnerSelectionInEditorAndWait(final int selection, CallbackHelper helper)
+ protected void setSpinnerSelectionInEditor(final int selection, CallbackHelper helper)
throws InterruptedException, TimeoutException {
int callCount = helper.getCallCount();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
((Spinner) mUI.getEditorView().findViewById(R.id.spinner)).setSelection(selection);
- }
- });
- 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 {
- int callCount = helper.getCallCount();
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- ViewGroup contents = (ViewGroup)
- mUI.getCardEditorView().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++]);
- }
- }
}
});
helper.waitForCallback(callCount);
@@ -354,23 +286,10 @@
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- List<EditText> fields = mUI.getEditorView().getEditableTextFieldsForTest();
+ List<EditorTextField> fields = mUI.getEditorView().getEditorTextFields();
for (int i = 0; i < values.length; i++) {
- fields.get(i).setText(values[i]);
+ fields.get(i).getEditText().setText(values[i]);
}
- }
- });
- helper.waitForCallback(callCount);
- }
-
- /** Directly sets the checkbox selection in the editor UI for credit cards. */
- protected void selectCheckboxAndWait(final int resourceId, final boolean isChecked,
- CallbackHelper helper) throws InterruptedException, TimeoutException {
- int callCount = helper.getCallCount();
- ThreadUtils.runOnUiThreadBlocking(new Runnable() {
- @Override
- public void run() {
- ((CheckBox) mUI.getCardEditorView().findViewById(resourceId)).setChecked(isChecked);
}
});
helper.waitForCallback(callCount);
@@ -481,12 +400,6 @@
}
@Override
- public void onPaymentRequestServiceBillingAddressChangeProcessed() {
- ThreadUtils.assertOnUiThread();
- mBillingAddressChangeProcessed.notifyCalled();
- }
-
- @Override
public void onCardUnmaskPromptReadyForInput(CardUnmaskPrompt prompt) {
ThreadUtils.assertOnUiThread();
mReadyForUnmaskInput.notifyCalled(prompt);

Powered by Google App Engine
This is Rietveld 408576698