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

Commit 0686931b authored by Alex Chau's avatar Alex Chau
Browse files

Use DeviceProfile.isTwoPanels for two panels expectation in tests

Fix: 193810767
Test: TaplTestsLauncher3.testWorkspace
Change-Id: Ifec5506415b79f3effa84fe0163eb1bb2bc7cc8d
parent c0fe7b1c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -121,6 +121,11 @@ public class TestInformationHandler implements ResourceBasedOverride {
                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, mDeviceProfile.isTablet);
                return response;

            case TestProtocol.REQUEST_IS_TWO_PANELS:
                response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
                    mDeviceProfile.isTwoPanels);
                return response;

            default:
                return null;
        }
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ public final class TestProtocol {
    public static final String REQUEST_STOP_EVENT_LOGGING = "stop-event-logging";
    public static final String REQUEST_CLEAR_DATA = "clear-data";
    public static final String REQUEST_IS_TABLET = "is-tablet";
    public static final String REQUEST_IS_TWO_PANELS = "is-two-panel";

    public static boolean sDebugTracing = false;
    public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
    }

    private int pagesPerScreen() {
        return mLauncher.isTablet() ? 2 : 1;
        return mLauncher.isTwoPanels() ? 2 : 1;
    }

    private boolean isWorkspaceScrollable(Launcher launcher) {
+5 −0
Original line number Diff line number Diff line
@@ -288,6 +288,11 @@ public final class LauncherInstrumentation {
                .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD);
    }

    public boolean isTwoPanels() {
        return getTestInfo(TestProtocol.REQUEST_IS_TWO_PANELS)
            .getBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD);
    }

    void setActiveContainer(VisibleContainer container) {
        sActiveContainer = new WeakReference<>(container);
    }
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ public final class Workspace extends Home {
    }

    private boolean isWorkspaceScrollable(UiObject2 workspace) {
        return workspace.getChildCount() > (mLauncher.isTablet() ? 2 : 1);
        return workspace.getChildCount() > (mLauncher.isTwoPanels() ? 2 : 1);
    }

    @NonNull