Chromium Code Reviews| 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 { |