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

Commit 8c2efd0d authored by vadimt's avatar vadimt
Browse files

Enabling some tests in landscape mode

Bug: 121280703
Change-Id: I285638d832594d5fed26ee812737a4356b110899
parent e1335c23
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -188,14 +188,6 @@ public abstract class AbstractLauncherUiTest {
        }
    }

    protected void lockRotation(boolean naturalOrientation) throws RemoteException {
        if (naturalOrientation) {
            mDevice.setOrientationNatural();
        } else {
            mDevice.setOrientationRight();
        }
    }

    protected void clearLauncherData() throws IOException, InterruptedException {
        if (TestHelpers.isInLauncherProcess()) {
            LauncherSettings.Settings.call(mTargetContext.getContentResolver(),
+5 −25
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.ShellCommandRule;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -69,34 +68,22 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest {
    }

    @Test
    @PortraitLandscape
    public void testWidgetConfig() throws Throwable {
        runTest(false, true);
    }

    @Test
    @Ignore // b/121280703
    public void testWidgetConfig_rotate() throws Throwable {
        runTest(true, true);
        runTest(true);
    }

    @Test
    @PortraitLandscape
    public void testConfigCancelled() throws Throwable {
        runTest(false, false);
        runTest(false);
    }

    @Test
    @Ignore // b/121280703
    public void testConfigCancelled_rotate() throws Throwable {
        runTest(true, false);
    }

    /**
     * @param rotateConfig should the config screen be rotated
     * @param acceptConfig accept the config activity
     */
    private void runTest(boolean rotateConfig, boolean acceptConfig) throws Throwable {
        lockRotation(true);

    private void runTest(boolean acceptConfig) throws Throwable {
        clearHomescreen();
        mDevice.pressHome();

@@ -110,13 +97,6 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest {
        // Widget id for which the config activity was opened
        mWidgetId = monitor.getWidgetId();

        if (rotateConfig) {
            // Rotate the screen and verify that the config activity is recreated
            monitor = new WidgetConfigStartupMonitor();
            lockRotation(false);
            assertEquals(mWidgetId, monitor.getWidgetId());
        }

        // Verify that the widget id is valid and bound
        assertNotNull(mAppWidgetManager.getAppWidgetInfo(mWidgetId));

+2 −14
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.TestViewHelpers;
import com.android.launcher3.util.rule.ShellCommandRule;

import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -41,19 +40,8 @@ public class AddWidgetTest extends AbstractLauncherUiTest {
    @Rule public ShellCommandRule mGrantWidgetRule = ShellCommandRule.grantWidgetBind();

    @Test
    public void testDragIcon_portrait() throws Throwable {
        lockRotation(true);
        performTest();
    }

    @Test
    @Ignore // b/121280703
    public void testDragIcon_landscape() throws Throwable {
        lockRotation(false);
        performTest();
    }

    private void performTest() throws Throwable {
    @PortraitLandscape
    public void testDragIcon() throws Throwable {
        clearHomescreen();
        mDevice.pressHome();

+0 −2
Original line number Diff line number Diff line
@@ -128,8 +128,6 @@ public class RequestPinItemTest extends AbstractLauncherUiTest {
        if (!Utilities.ATLEAST_OREO) {
            return;
        }
        lockRotation(true);

        clearHomescreen();
        mDevice.pressHome();