summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-11-12 16:57:48 -0800
committerVadim Tryshev <vadimt@google.com>2019-11-13 21:45:16 +0000
commitec7c044c89fb9168d44b81c58325aaba3ec73606 (patch)
tree9da48222eb79ae859faa69cff76324c0500a3142 /tests
parent992cfbf63d13e9490f4726119733fda7f638089c (diff)
downloadandroid_packages_apps_Trebuchet-ec7c044c89fb9168d44b81c58325aaba3ec73606.tar.gz
android_packages_apps_Trebuchet-ec7c044c89fb9168d44b81c58325aaba3ec73606.tar.bz2
android_packages_apps_Trebuchet-ec7c044c89fb9168d44b81c58325aaba3ec73606.zip
Tapl: AllApps: ensuring a minimal vertical size of an icon
Clicking an icon within its padding area is ignored by Launcher. Hence, ensuring that the icon on AllApps is higher that 2 paddings. Bug: 141770616 Change-Id: I19e3ba7cfa25de75a47202845d0838bea46af92c Merged-In: I19e3ba7cfa25de75a47202845d0838bea46af92c
Diffstat (limited to 'tests')
-rw-r--r--tests/tapl/com/android/launcher3/tapl/AllApps.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java
index 6dced8c8c..96e4b8c91 100644
--- a/tests/tapl/com/android/launcher3/tapl/AllApps.java
+++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java
@@ -36,6 +36,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
private static final int MAX_SCROLL_ATTEMPTS = 40;
private final int mHeight;
+ private final int mIconHeight;
AllApps(LauncherInstrumentation launcher) {
super(launcher);
@@ -46,6 +47,10 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
// Wait for the recycler to populate.
mLauncher.waitForObjectInContainer(appListRecycler, By.clazz(TextView.class));
verifyNotFrozen("All apps freeze flags upon opening all apps");
+ mIconHeight = mLauncher.getTestInfo(
+ TestProtocol.REQUEST_ICON_HEIGHT)
+ .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD);
+
}
@Override
@@ -62,6 +67,10 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
}
final Rect iconBounds = icon.getVisibleBounds();
LauncherInstrumentation.log("hasClickableIcon: icon bounds: " + iconBounds);
+ if (iconBounds.height() < mIconHeight / 2) {
+ LauncherInstrumentation.log("hasClickableIcon: icon has insufficient height");
+ return false;
+ }
if (iconCenterInSearchBox(allAppsContainer, icon)) {
LauncherInstrumentation.log("hasClickableIcon: icon center is under search box");
return false;