summaryrefslogtreecommitdiffstats
path: root/tests/src/com/android
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-05-13 18:28:19 -0700
committervadimt <vadimt@google.com>2019-05-13 18:28:19 -0700
commit0edb04ca248da66e3013690be6fd73f9d472d3a4 (patch)
tree30c7ba664a7147a954fa2ab6f0f18be6344321a7 /tests/src/com/android
parentfc65c357a1e396d3ee2b9b1a90f34011e12f1f6c (diff)
downloadandroid_packages_apps_Trebuchet-0edb04ca248da66e3013690be6fd73f9d472d3a4.tar.gz
android_packages_apps_Trebuchet-0edb04ca248da66e3013690be6fd73f9d472d3a4.tar.bz2
android_packages_apps_Trebuchet-0edb04ca248da66e3013690be6fd73f9d472d3a4.zip
Fixing flakiness of widget tests
Change-Id: I1af6a733a3a7a89899c83d6714117ff9a51528d2
Diffstat (limited to 'tests/src/com/android')
-rw-r--r--tests/src/com/android/launcher3/ui/TestViewHelpers.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/src/com/android/launcher3/ui/TestViewHelpers.java b/tests/src/com/android/launcher3/ui/TestViewHelpers.java
index 2116f5e2d..a73bde011 100644
--- a/tests/src/com/android/launcher3/ui/TestViewHelpers.java
+++ b/tests/src/com/android/launcher3/ui/TestViewHelpers.java
@@ -27,6 +27,7 @@ import android.graphics.Point;
import android.os.Process;
import android.os.SystemClock;
import android.util.Log;
+import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
@@ -186,10 +187,8 @@ public class TestViewHelpers {
*/
public static UiObject2 openWidgetsTray() {
final UiDevice device = getDevice();
- device.pressMenu(); // Enter overview mode.
- device.wait(Until.findObject(
- By.text(getTargetContext().getString(R.string.widget_button_text))),
- AbstractLauncherUiTest.DEFAULT_UI_TIMEOUT).click();
+ device.pressKeyCode(KeyEvent.KEYCODE_W, KeyEvent.META_CTRL_ON);
+ device.waitForIdle();
return findViewById(R.id.widgets_list_view);
}