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

Commit a705fdf7 authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Waiting for Normal state when closing search result by touching outside

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: I2e90105057de44fff96d6d0fd740f963465be57e
parent 0a1c916f
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package com.android.launcher3.tapl;

import static com.android.launcher3.testing.shared.TestProtocol.NORMAL_STATE_ORDINAL;

import android.widget.TextView;

import androidx.test.uiautomator.By;
@@ -87,7 +89,7 @@ public class SearchResultFromQsb implements SearchInputSource {
                             + (tapRight ? "right" : "left"))) {
            final UiObject2 allAppsBottomSheet =
                    mLauncher.waitForLauncherObject(BOTTOM_SHEET_RES_ID);
            mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight);
            tapOutside(tapRight, allAppsBottomSheet);
            try (LauncherInstrumentation.Closable tapped = mLauncher.addContextLayer(
                    "tapped outside AllApps bottom sheet")) {
                verifyVisibleContainerOnDismiss();
@@ -95,6 +97,13 @@ public class SearchResultFromQsb implements SearchInputSource {
        }
    }

    protected void tapOutside(boolean tapRight, UiObject2 allAppsBottomSheet) {
        mLauncher.runToState(
                () -> mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight),
                NORMAL_STATE_ORDINAL,
                "tappig outside");
    }

    protected void verifyVisibleContainerOnDismiss() {
        mLauncher.getWorkspace();
    }
+5 −0
Original line number Diff line number Diff line
@@ -50,4 +50,9 @@ public class SearchResultFromTaskbarQsb extends SearchResultFromQsb {
    protected void verifyVisibleContainerOnDismiss() {
        mLauncher.getLaunchedAppState().assertTaskbarVisible();
    }

    @Override
    protected void tapOutside(boolean tapRight, UiObject2 allAppsBottomSheet) {
        mLauncher.touchOutsideContainer(allAppsBottomSheet, tapRight);
    }
}