mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Merge "Verifying that workspace looks correct at the end of the test." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
0d50b19f4b
@@ -16,9 +16,7 @@
|
||||
package com.android.quickstep;
|
||||
|
||||
import static android.content.pm.PackageManager.MATCH_DISABLED_COMPONENTS;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
|
||||
import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS;
|
||||
import static com.android.launcher3.tapl.TestHelpers.getHomeIntentInPackage;
|
||||
import static com.android.launcher3.tapl.TestHelpers.getLauncherInMyProcess;
|
||||
@@ -34,7 +32,6 @@ import static com.android.launcher3.util.rule.ShellCommandRule.disableHeadsUpNot
|
||||
import static com.android.launcher3.util.rule.ShellCommandRule.getLauncherCommand;
|
||||
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;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
@@ -61,6 +58,7 @@ import com.android.launcher3.util.Wait;
|
||||
import com.android.launcher3.util.rule.FailureWatcher;
|
||||
import com.android.launcher3.util.rule.SamplerRule;
|
||||
import com.android.launcher3.util.rule.ScreenRecordRule;
|
||||
import com.android.launcher3.util.rule.TestIsolationRule;
|
||||
import com.android.launcher3.util.rule.TestStabilityRule;
|
||||
import com.android.launcher3.util.rule.ViewCaptureRule;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
@@ -93,9 +91,6 @@ public class FallbackRecentsTest {
|
||||
@Rule
|
||||
public final TestRule mDisableHeadsUpNotification = disableHeadsUpNotification();
|
||||
|
||||
@Rule
|
||||
public final TestRule mSetLauncherCommand;
|
||||
|
||||
@Rule
|
||||
public final TestRule mOrderSensitiveRules;
|
||||
|
||||
@@ -116,19 +111,7 @@ public class FallbackRecentsTest {
|
||||
Utilities.enableRunningInTestHarnessForTests();
|
||||
}
|
||||
|
||||
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule(
|
||||
RecentsActivity.ACTIVITY_TRACKER::getCreatedActivity);
|
||||
mOrderSensitiveRules = RuleChain
|
||||
.outerRule(new SamplerRule())
|
||||
.around(new NavigationModeSwitchRule(mLauncher))
|
||||
.around(new FailureWatcher(mLauncher, viewCaptureRule::getViewCaptureData))
|
||||
.around(viewCaptureRule);
|
||||
|
||||
mOtherLauncherActivity = context.getPackageManager().queryIntentActivities(
|
||||
getHomeIntentInPackage(context),
|
||||
MATCH_DISABLED_COMPONENTS).get(0).activityInfo;
|
||||
|
||||
mSetLauncherCommand = (base, desc) -> new Statement() {
|
||||
final TestRule setLauncherCommand = (base, desc) -> new Statement() {
|
||||
@Override
|
||||
public void evaluate() throws Throwable {
|
||||
TestCommandReceiver.callCommand(TestCommandReceiver.ENABLE_TEST_LAUNCHER);
|
||||
@@ -151,6 +134,21 @@ public class FallbackRecentsTest {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
final ViewCaptureRule viewCaptureRule = new ViewCaptureRule(
|
||||
RecentsActivity.ACTIVITY_TRACKER::getCreatedActivity);
|
||||
mOrderSensitiveRules = RuleChain
|
||||
.outerRule(new SamplerRule())
|
||||
.around(new NavigationModeSwitchRule(mLauncher))
|
||||
.around(new FailureWatcher(mLauncher, viewCaptureRule::getViewCaptureData))
|
||||
.around(viewCaptureRule)
|
||||
.around(new TestIsolationRule(mLauncher))
|
||||
.around(setLauncherCommand);
|
||||
|
||||
mOtherLauncherActivity = context.getPackageManager().queryIntentActivities(
|
||||
getHomeIntentInPackage(context),
|
||||
MATCH_DISABLED_COMPONENTS).get(0).activityInfo;
|
||||
|
||||
if (TestHelpers.isInLauncherProcess()) {
|
||||
mLauncher.setSystemHealthSupplier(startTime -> TestCommandReceiver.callCommand(
|
||||
TestCommandReceiver.GET_SYSTEM_HEALTH_MESSAGE, startTime.toString()).
|
||||
|
||||
Reference in New Issue
Block a user