diff --git a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java index 9d942c5380..eb48cc543d 100644 --- a/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java +++ b/quickstep/src/com/android/quickstep/QuickstepTestInformationHandler.java @@ -18,6 +18,7 @@ import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.DisplayController; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.util.TISBindHelper; +import com.android.quickstep.views.RecentsView; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; @@ -77,6 +78,11 @@ public class QuickstepTestInformationHandler extends TestInformationHandler { return response; } + case TestProtocol.REQUEST_GET_OVERVIEW_CURRENT_PAGE_INDEX: { + return getLauncherUIProperty(Bundle::putInt, + launcher -> launcher.getOverviewPanel().getCurrentPage()); + } + case TestProtocol.REQUEST_HAS_TIS: { response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, true); return response; diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 25adb62d2f..65ee1ab125 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -28,7 +28,6 @@ import static org.junit.Assume.assumeTrue; import android.content.Intent; import android.content.res.Configuration; -import android.platform.test.annotations.PlatinumTest; import androidx.test.filters.LargeTest; import androidx.test.platform.app.InstrumentationRegistry; @@ -112,7 +111,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape - @PlatinumTest(focusArea = "launcher") public void testOverview() throws Exception { startTestAppsWithCheck(); // mLauncher.pressHome() also tests an important case of pressing home while in background. @@ -369,7 +367,6 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { @Test @PortraitLandscape @TaskbarModeSwitch() - @PlatinumTest(focusArea = "launcher") @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT) // b/309820115 @ScreenRecord // b/309820115 public void testOverviewForTablet() throws Exception { diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index 2c834bdb3f..7b192dc7b4 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -330,6 +330,7 @@ public class TestInformationHandler implements ResourceBasedOverride { return null; } T value = provider.apply(target); + Bundle response = new Bundle(); bundleSetter.set(response, TestProtocol.TEST_INFO_RESPONSE_FIELD, value); return response; diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java index fcb5158165..6f93766a04 100644 --- a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java +++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java @@ -147,6 +147,8 @@ public final class TestProtocol { public static final String REQUEST_GET_GRID_TASK_SIZE_RECT_FOR_TABLET = "get-grid-task-size-rect-for-tablet"; public static final String REQUEST_GET_OVERVIEW_PAGE_SPACING = "get-overview-page-spacing"; + public static final String REQUEST_GET_OVERVIEW_CURRENT_PAGE_INDEX = + "get-overview-current-page-index"; public static final String REQUEST_ENABLE_ROTATION = "enable_rotation"; public static final String REQUEST_ENABLE_SUGGESTION = "enable-suggestion"; public static final String REQUEST_MODEL_QUEUE_CLEARED = "model-queue-cleared"; diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 7d3807e0c9..f065ef5b0c 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -406,6 +406,11 @@ public final class LauncherInstrumentation { .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); } + public int getOverviewCurrentPageIndex() { + return getTestInfo(TestProtocol.REQUEST_GET_OVERVIEW_CURRENT_PAGE_INDEX) + .getInt(TestProtocol.TEST_INFO_RESPONSE_FIELD); + } + float getExactScreenCenterX() { return getRealDisplaySize().x / 2f; }