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

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: 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
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..0cb1c67a226f64dfba5bf03282d495a10a53d2ec 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,22 @@ 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));
+ }
+ });
+ getInstrumentation().waitForIdleSync();
please use gerrit instead 2017/02/21 19:33:08 Why is this line necessary in this method? It's no
gogerald1 2017/02/21 20:44:03 Done.
+ helper.waitForCallback(callCount);
+ }
+
/** Clicks on a button in the card unmask UI. */
protected void clickCardUnmaskButtonAndWait(final int dialogButtonId, CallbackHelper helper)
throws InterruptedException, TimeoutException {

Powered by Google App Engine
This is Rietveld 408576698