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

Commit 10ac692f authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

Merge "Waiting for AllApps state when clicking Qsb" into main

parents 0896b68c 819a55f6
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;