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

Commit 819a55f6 authored by Vadim Tryshev's avatar Vadim Tryshev
Browse files

Waiting for AllApps state when clicking Qsb

Bug: 313926097
Flag: N/A
Test: presubmit
Change-Id: Idf0639a1d91ad3fba40ab5589595b6376d49fd6d
parent f0b1ddc0
Loading
Loading
Loading
Loading
+11 −0
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.ALL_APPS_STATE_ORDINAL;

import androidx.test.uiautomator.UiObject2;

/**
@@ -25,4 +27,13 @@ class HomeQsb extends Qsb {
    HomeQsb(LauncherInstrumentation launcher, UiObject2 hotseat) {
        super(launcher, hotseat, "search_container_hotseat");
    }

    @Override
    protected void clickQsb() {
        // Clicking Qsb will switch to All Apps state.
        mLauncher.runToState(
                () -> super.clickQsb(),
                ALL_APPS_STATE_ORDINAL,
                "Clicking Qsb");
    }
}
+5 −3
Original line number Diff line number Diff line
@@ -118,9 +118,7 @@ public abstract class Qsb implements SearchInputSource {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                "want to open search result page");
             LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
            mLauncher.clickLauncherObject(waitForQsbObject());
            // wait for the result rendering to complete
            mLauncher.waitForIdle();
            clickQsb();
            try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer(
                    "clicked qsb to open search result page")) {
                return createSearchResult();
@@ -128,6 +126,10 @@ public abstract class Qsb implements SearchInputSource {
        }
    }

    protected void clickQsb() {
        mLauncher.clickLauncherObject(waitForQsbObject());
    }

    @Override
    public LauncherInstrumentation getLauncher() {
        return mLauncher;