Stress test for starting Launcher via gestures

Ideally, we should have a race condition tests, but with the new
single-threaded model, this requires more work. This is a temporary
measure.

Change-Id: Ie180883f4b186e4c4087dc77fed1e4d946402465
This commit is contained in:
vadimt
2019-03-11 13:37:54 -07:00
parent 0aa0e2737e
commit c1f88db00a

View File

@@ -37,6 +37,9 @@ import org.junit.runner.RunWith;
@LargeTest
@RunWith(AndroidJUnit4.class)
public class StartLauncherViaGestureTests extends AbstractQuickStepTest {
static final int STRESS_REPEAT_COUNT = 10;
@Override
@Before
public void setUp() throws Exception {
@@ -79,4 +82,28 @@ public class StartLauncherViaGestureTests extends AbstractQuickStepTest {
closeLauncherActivity();
mLauncher.getBackground().switchToOverview();
}
@Test
@QuickstepOnOff
public void testStressPressHome() {
for (int i = 0; i < STRESS_REPEAT_COUNT; ++i) {
// Destroy Launcher activity.
closeLauncherActivity();
// The test action.
mLauncher.pressHome();
}
}
@Test
@QuickstepOnOff
public void testStressSwipeToOverview() {
for (int i = 0; i < STRESS_REPEAT_COUNT; ++i) {
// Destroy Launcher activity.
closeLauncherActivity();
// The test action.
mLauncher.getBackground().switchToOverview();
}
}
}