From 9675452c2f1c2d5bc82b09624958c932cc8a37d8 Mon Sep 17 00:00:00 2001 From: vadimt Date: Tue, 14 Jan 2020 19:39:35 -0800 Subject: [PATCH] Better diags and a small correction for scrolling in AllApps Change-Id: I48dbba26139f42350831fb707bea847b7c76129f --- src/com/android/launcher3/testing/TestInformationHandler.java | 4 ++-- tests/tapl/com/android/launcher3/tapl/AllApps.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index ecfc77ccf1..506830d531 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -126,11 +126,11 @@ public class TestInformationHandler implements ResourceBasedOverride { case TestProtocol.REQUEST_APPS_LIST_SCROLL_Y: { try { - final int deferUpdatesFlags = MAIN_EXECUTOR.submit(() -> + final int scroll = MAIN_EXECUTOR.submit(() -> mLauncher.getAppsView().getActiveRecyclerView().getCurrentScrollY()) .get(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, - deferUpdatesFlags); + scroll); } catch (ExecutionException | InterruptedException e) { throw new RuntimeException(e); } diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 3bdeb14925..e344bbdb71 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -130,6 +130,9 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { searchBox.getVisibleBounds().bottom - allAppsContainer.getVisibleBounds().top); final int newScroll = getAllAppsScroll(); + mLauncher.assertTrue( + "Scrolled in a wrong direction in AllApps: from " + scroll + " to " + + newScroll, newScroll >= scroll); if (newScroll == scroll) break; mLauncher.assertTrue(