Enabling some tests in landscape mode

Bug: 121280703
Change-Id: I285638d832594d5fed26ee812737a4356b110899
This commit is contained in:
vadimt
2019-09-04 17:33:52 -07:00
parent e1335c2359
commit 8c2efd0de0
4 changed files with 7 additions and 49 deletions

View File

@@ -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(),

View File

@@ -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));

View File

@@ -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();

View File

@@ -128,8 +128,6 @@ public class RequestPinItemTest extends AbstractLauncherUiTest {
if (!Utilities.ATLEAST_OREO) {
return;
}
lockRotation(true);
clearHomescreen();
mDevice.pressHome();