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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java

Issue 662493006: Replace flaky KeyUtils methods with more robust variant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | content/public/test/android/javatests/src/org/chromium/content/browser/test/util/KeyUtils.java » ('j') | 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/contextmenu/ContextMenuTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
index b3692f81056ddd9caa75d89a45efe65fde995c3f..79f59fd8157ffef265e1f4bdef384ff99c42cb03 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextmenu/ContextMenuTest.java
@@ -11,6 +11,7 @@ import android.os.Build;
import android.test.FlakyTest;
import android.test.suitebuilder.annotation.MediumTest;
import android.view.ContextMenu;
+import android.view.KeyEvent;
import junit.framework.Assert;
@@ -178,8 +179,7 @@ public class ContextMenuTest extends ChromeShellTestBase {
assertNotNull("Context menu was not properly created", menu);
assertFalse("Context menu did not have window focus", getActivity().hasWindowFocus());
- KeyUtils.pressBack(getInstrumentation());
-
+ KeyUtils.singleKeyEventView(getInstrumentation(), tab.getView(), KeyEvent.KEYCODE_BACK);
Assert.assertTrue("Activity did not regain focus.",
CriteriaHelper.pollForCriteria(new Criteria() {
@Override
« no previous file with comments | « no previous file | content/public/test/android/javatests/src/org/chromium/content/browser/test/util/KeyUtils.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698