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

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

Merge "Re-promoting testDragToFolder to postsubmit" into main

parents 19265a47 0df6404e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -153,11 +153,13 @@ public class TestInformationHandler implements ResourceBasedOverride {
                }, this::getCurrentActivity);
            }

            case TestProtocol.REQUEST_IME_INSETS: {
            case TestProtocol.REQUEST_SYSTEM_GESTURE_REGION: {
                return getUIProperty(Bundle::putParcelable, activity -> {
                    WindowInsetsCompat insets = WindowInsetsCompat.toWindowInsetsCompat(
                            activity.getWindow().getDecorView().getRootWindowInsets());
                    return insets.getInsets(WindowInsetsCompat.Type.ime()).toPlatformInsets();
                    return insets.getInsets(WindowInsetsCompat.Type.ime()
                            | WindowInsetsCompat.Type.systemGestures())
                            .toPlatformInsets();
                }, this::getCurrentActivity);
            }

+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ public final class TestProtocol {
    public static final String REQUEST_WIDGETS_SCROLL_Y = "widgets-scroll-y";
    public static final String REQUEST_TARGET_INSETS = "target-insets";
    public static final String REQUEST_WINDOW_INSETS = "window-insets";
    public static final String REQUEST_IME_INSETS = "ime-insets";
    public static final String REQUEST_SYSTEM_GESTURE_REGION = "gesture-region";
    public static final String REQUEST_PID = "pid";
    public static final String REQUEST_FORCE_GC = "gc";
    public static final String REQUEST_RECENT_TASKS_LIST = "recent-tasks-list";
+5 −2
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import static com.android.launcher3.util.TestConstants.AppNames.GMAIL_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.MAPS_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.STORE_APP_NAME;
import static com.android.launcher3.ui.AbstractLauncherUiTest.initialize;
import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -40,9 +42,9 @@ import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.TestUtil;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.TestStabilityRule;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

/**
@@ -71,7 +73,8 @@ public class TaplDragTest extends AbstractLauncherUiTest {
    @Test
    @PortraitLandscape
    @ScreenRecord
    @Ignore // b/233075289
    // Staging; will be promoted to presubmit if stable
    @TestStabilityRule.Stability(flavors = LOCAL | PLATFORM_POSTSUBMIT)
    @PlatinumTest(focusArea = "launcher")
    public void testDragToFolder() {
        // TODO: add the use case to drag an icon to an existing folder. Currently it either fails
+5 −4
Original line number Diff line number Diff line
@@ -385,8 +385,8 @@ public final class LauncherInstrumentation {
                .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD);
    }

    Insets getImeInsets() {
        return getTestInfo(TestProtocol.REQUEST_IME_INSETS)
    Insets getSystemGestureRegion() {
        return getTestInfo(TestProtocol.REQUEST_SYSTEM_GESTURE_REGION)
                .getParcelable(TestProtocol.TEST_INFO_RESPONSE_FIELD);
    }

@@ -2366,12 +2366,13 @@ public final class LauncherInstrumentation {
                        : containerBounds.left - 1;
            }
            // If IME is visible and overlaps the container bounds, touch above it.
            final Insets systemGestureRegion = getSystemGestureRegion();
            int bottomBound = Math.min(
                    containerBounds.bottom,
                    getRealDisplaySize().y - getImeInsets().bottom);
                    getRealDisplaySize().y - systemGestureRegion.bottom);
            int y = (bottomBound - containerBounds.top) / 2;
            // Do not tap in the status bar.
            y = Math.max(y, getWindowInsets().top);
            y = Math.max(y, systemGestureRegion.top);

            final long downTime = SystemClock.uptimeMillis();
            final Point tapTarget = new Point(x, y);