Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad885616 authored by Jagrut Desai's avatar Jagrut Desai Committed by Android (Google) Code Review
Browse files

Merge "Migrating Tapl Overview test to platform scenario project" into main

parents 49374a90 71e8dcca
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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.<RecentsView>getOverviewPanel().getCurrentPage());
            }

            case TestProtocol.REQUEST_HAS_TIS: {
                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, true);
                return response;
+0 −3
Original line number Diff line number Diff line
@@ -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;
@@ -113,7 +112,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.
@@ -412,7 +410,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 {
+1 −0
Original line number Diff line number Diff line
@@ -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;
+2 −0
Original line number Diff line number Diff line
@@ -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";
+5 −0
Original line number Diff line number Diff line
@@ -420,6 +420,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;
    }