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

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

Issue 2706043004: [Payments] Add integration test for canceling editor by clicking Android back button (Closed)
Patch Set: address comments 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
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.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 c061c3520eb5a1657e3b0383e9ba36ecb9a48c01..9ad1f91c7f86b1e3106f747ff22d740377646505 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
@@ -7,6 +7,7 @@ package org.chromium.chrome.browser.payments;
import static java.util.Arrays.asList;
import android.os.Handler;
+import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
@@ -281,6 +282,21 @@ abstract class PaymentRequestTestBase extends ChromeActivityTestCaseBase<ChromeT
helper.waitForCallback(callCount);
}
+ protected void clickAndroidBackButtonInEditorAndWait(CallbackHelper helper)
+ throws InterruptedException, TimeoutException {
+ int callCount = helper.getCallCount();
+ ThreadUtils.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ mUI.getEditorView().dispatchKeyEvent(
+ new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));
+ mUI.getEditorView().dispatchKeyEvent(
+ new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));
+ }
+ });
+ helper.waitForCallback(callCount);
+ }
+
/** Clicks on a button in the card unmask UI. */
protected void clickCardUnmaskButtonAndWait(final int dialogButtonId, CallbackHelper helper)
throws InterruptedException, TimeoutException {
« no previous file with comments | « chrome/android/javatests/src/org/chromium/chrome/browser/payments/PaymentRequestShippingAddressTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698