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

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

Issue 2108623004: Reland: Refactor contact editor controller into its own class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneTest.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 126a02a78118821e62eeacf8cb7ea3a317ad2df7..81470abc1e3e69e7eae1c39b23c79418cfee0a97 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
@@ -46,6 +46,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
protected final PaymentsCallbackHelper<CardUnmaskPrompt> mReadyToUnmask;
protected final CallbackHelper mReadyToEdit;
protected final CallbackHelper mEditorValidationError;
+ protected final CallbackHelper mEditorTextUpdate;
protected final CallbackHelper mEditorDismissed;
protected final CallbackHelper mDismissed;
protected final CallbackHelper mUnableToAbort;
@@ -65,6 +66,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
mReadyToUnmask = new PaymentsCallbackHelper<>();
mReadyToEdit = new CallbackHelper();
mEditorValidationError = new CallbackHelper();
+ mEditorTextUpdate = new CallbackHelper();
mEditorDismissed = new CallbackHelper();
mDismissed = new CallbackHelper();
mUnableToAbort = new CallbackHelper();
@@ -140,7 +142,7 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- mUI.getEditorViewForTest().findViewById(resourceId).performClick();
+ mUI.getEditorView().findViewById(resourceId).performClick();
}
});
helper.waitForCallback(callCount);
@@ -171,14 +173,16 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
}
/** Directly sets the text in the editor UI. */
- protected void setTextInEditor(final int resourceId, final String input)
- throws InterruptedException, TimeoutException {
+ protected void setTextInEditorAndWait(final int resourceId, final String input,
+ CallbackHelper helper) throws InterruptedException, TimeoutException {
+ int callCount = helper.getCallCount();
ThreadUtils.runOnUiThreadBlocking(new Runnable() {
@Override
public void run() {
- ((EditText) mUI.getEditorViewForTest().findViewById(resourceId)).setText(input);
+ ((EditText) mUI.getEditorView().findViewById(resourceId)).setText(input);
}
});
+ helper.waitForCallback(callCount);
}
/** Directly sets the text in the card unmask UI. */
@@ -244,6 +248,12 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeA
}
@Override
+ public void onPaymentRequestEditorTextUpdate() {
+ ThreadUtils.assertOnUiThread();
+ mEditorTextUpdate.notifyCalled();
+ }
+
+ @Override
public void onPaymentRequestEditorDismissed() {
ThreadUtils.assertOnUiThread();
mEditorDismissed.notifyCalled();
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestPhoneTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698