Loading src/com/android/launcher3/testing/TestInformationHandler.java +6 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,12 @@ public class TestInformationHandler implements ResourceBasedOverride { mLeaks.add(new View(mContext)); break; } case TestProtocol.REQUEST_ICON_HEIGHT: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.allAppsCellHeightPx); break; } } return response; } Loading src/com/android/launcher3/testing/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ public final class TestProtocol { "all-apps-to-overview-swipe-height"; public static final String REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT = "home-to-all-apps-swipe-height"; public static final String REQUEST_ICON_HEIGHT = "icon-height"; public static final String REQUEST_HOTSEAT_TOP = "hotseat-top"; public static final String REQUEST_IS_LAUNCHER_INITIALIZED = "is-launcher-initialized"; public static final String REQUEST_FREEZE_APP_LIST = "freeze-app-list"; Loading tests/tapl/com/android/launcher3/tapl/AllApps.java +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,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); Loading @@ -48,6 +49,9 @@ 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 Loading @@ -64,6 +68,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; Loading Loading
src/com/android/launcher3/testing/TestInformationHandler.java +6 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,12 @@ public class TestInformationHandler implements ResourceBasedOverride { mLeaks.add(new View(mContext)); break; } case TestProtocol.REQUEST_ICON_HEIGHT: { response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.allAppsCellHeightPx); break; } } return response; } Loading
src/com/android/launcher3/testing/TestProtocol.java +2 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ public final class TestProtocol { "all-apps-to-overview-swipe-height"; public static final String REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT = "home-to-all-apps-swipe-height"; public static final String REQUEST_ICON_HEIGHT = "icon-height"; public static final String REQUEST_HOTSEAT_TOP = "hotseat-top"; public static final String REQUEST_IS_LAUNCHER_INITIALIZED = "is-launcher-initialized"; public static final String REQUEST_FREEZE_APP_LIST = "freeze-app-list"; Loading
tests/tapl/com/android/launcher3/tapl/AllApps.java +8 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,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); Loading @@ -48,6 +49,9 @@ 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 Loading @@ -64,6 +68,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; Loading