mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Add support for testing in portrait mode
Bug: 110103162 Test: TaplTests Change-Id: I7f633405c04984ea8f04acdc6dd4ad21019d3409
This commit is contained in:
@@ -52,7 +52,6 @@ import com.android.launcher3.compat.LauncherAppsCompat;
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation;
|
||||
import com.android.launcher3.testcomponent.AppWidgetNoConfig;
|
||||
import com.android.launcher3.testcomponent.AppWidgetWithConfig;
|
||||
import com.android.launcher3.util.Condition;
|
||||
import com.android.launcher3.util.Wait;
|
||||
import com.android.launcher3.util.rule.LauncherActivityRule;
|
||||
|
||||
@@ -79,20 +78,23 @@ public abstract class AbstractLauncherUiTest {
|
||||
public static final long DEFAULT_WORKER_TIMEOUT_SECS = 5;
|
||||
|
||||
protected MainThreadExecutor mMainThreadExecutor = new MainThreadExecutor();
|
||||
protected UiDevice mDevice;
|
||||
protected LauncherInstrumentation mLauncher;
|
||||
protected final UiDevice mDevice;
|
||||
protected final LauncherInstrumentation mLauncher;
|
||||
protected Context mTargetContext;
|
||||
protected String mTargetPackage;
|
||||
|
||||
private static final String TAG = "AbstractLauncherUiTest";
|
||||
|
||||
protected AbstractLauncherUiTest() {
|
||||
mDevice = UiDevice.getInstance(getInstrumentation());
|
||||
mLauncher = new LauncherInstrumentation(getInstrumentation());
|
||||
}
|
||||
|
||||
@Rule
|
||||
public LauncherActivityRule mActivityMonitor = new LauncherActivityRule();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
mDevice = UiDevice.getInstance(getInstrumentation());
|
||||
mLauncher = new LauncherInstrumentation(getInstrumentation());
|
||||
mTargetContext = InstrumentationRegistry.getTargetContext();
|
||||
mTargetPackage = mTargetContext.getPackageName();
|
||||
mDevice.executeShellCommand("settings put global heads_up_notifications_enabled 0");
|
||||
@@ -285,12 +287,7 @@ public abstract class AbstractLauncherUiTest {
|
||||
// flakiness.
|
||||
protected boolean waitForLauncherCondition(
|
||||
Function<Launcher, Boolean> condition, long timeout) {
|
||||
return Wait.atMost(new Condition() {
|
||||
@Override
|
||||
public boolean isTrue() {
|
||||
return getFromLauncher(condition);
|
||||
}
|
||||
}, timeout);
|
||||
return Wait.atMost(() -> getFromLauncher(condition), timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user