From c1f88db00a219bc617f63b59af2bb6d01d632d08 Mon Sep 17 00:00:00 2001 From: vadimt Date: Mon, 11 Mar 2019 13:37:54 -0700 Subject: 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 --- .../quickstep/StartLauncherViaGestureTests.java | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java') diff --git a/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java index fe789aade..6031dcd71 100644 --- a/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java +++ b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java @@ -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(); + } + } } \ No newline at end of file -- cgit v1.2.3