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

Commit 163d4d01 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "TAPL: performing event verification for all gestures" into ub-launcher3-master

parents dda7490c 299aaf3a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ import android.util.Log;
import com.android.launcher3.Utilities;

public final class TestLogging {
    public static synchronized void recordEvent(String event) {
    public static void recordEvent(String event) {
        if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
            Log.d(TestProtocol.TAPL_EVENTS_TAG, event);
        }
+5 −3
Original line number Diff line number Diff line
@@ -37,8 +37,10 @@ public class AddToHomeScreenPrompt {
    }

    public void addAutomatically() {
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
            mLauncher.waitForObjectInContainer(
                    mWidgetCell.getParent().getParent().getParent().getParent(),
                    By.text(ADD_AUTOMATICALLY)).click();
        }
    }
}
+7 −4
Original line number Diff line number Diff line
@@ -99,7 +99,8 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
     */
    @NonNull
    public AppIcon getAppIcon(String appName) {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
             LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                     "getting app icon " + appName + " on all apps")) {
            final UiObject2 allAppsContainer = verifyActiveContainer();
            final UiObject2 appListRecycler = mLauncher.waitForObjectInContainer(allAppsContainer,
@@ -197,7 +198,8 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
     * Flings forward (down) and waits the fling's end.
     */
    public void flingForward() {
        try (LauncherInstrumentation.Closable c =
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
             LauncherInstrumentation.Closable c =
                     mLauncher.addContextLayer("want to fling forward in all apps")) {
            final UiObject2 allAppsContainer = verifyActiveContainer();
            // Start the gesture in the center to avoid starting at elements near the top.
@@ -211,7 +213,8 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer {
     * Flings backward (up) and waits the fling's end.
     */
    public void flingBackward() {
        try (LauncherInstrumentation.Closable c =
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
             LauncherInstrumentation.Closable c =
                     mLauncher.addContextLayer("want to fling backward in all apps")) {
            final UiObject2 allAppsContainer = verifyActiveContainer();
            // Start the gesture in the center, for symmetry with forward.
+3 −2
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ public final class AllAppsFromOverview extends AllApps {
     */
    @NonNull
    public Overview switchBackToOverview() {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
             LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                     "want to switch back from all apps to overview")) {
            final UiObject2 allAppsContainer = verifyActiveContainer();
            // Swipe from the search box to the bottom.
+4 −2
Original line number Diff line number Diff line
@@ -39,9 +39,11 @@ public final class AppIcon extends Launchable {
     * Long-clicks the icon to open its menu.
     */
    public AppIconMenu openMenu() {
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck()) {
            return new AppIconMenu(mLauncher, mLauncher.clickAndGet(
                    mObject, "deep_shortcuts_container"));
        }
    }

    @Override
    protected String getLongPressIndicator() {
Loading