summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java (renamed from quickstep/tests/src/com/android/quickstep/RaceConditionsTests.java)33
-rw-r--r--tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java11
2 files changed, 31 insertions, 13 deletions
diff --git a/quickstep/tests/src/com/android/quickstep/RaceConditionsTests.java b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java
index f132b12b4..52f3c538c 100644
--- a/quickstep/tests/src/com/android/quickstep/RaceConditionsTests.java
+++ b/quickstep/tests/src/com/android/quickstep/StartLauncherViaGestureTests.java
@@ -29,26 +29,26 @@ import com.android.launcher3.util.RaceConditionReproducer;
import com.android.quickstep.QuickStepOnOffRule.Mode;
import com.android.quickstep.QuickStepOnOffRule.QuickstepOnOff;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@LargeTest
@RunWith(AndroidJUnit4.class)
-public class RaceConditionsTests extends AbstractQuickStepTest {
+public class StartLauncherViaGestureTests extends AbstractQuickStepTest {
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ // Start an activity where the gestures start.
+ startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
+ }
+
private void runTest(String... eventSequence) {
final RaceConditionReproducer eventProcessor = new RaceConditionReproducer(eventSequence);
// Destroy Launcher activity.
- executeOnLauncher(launcher -> {
- if (launcher != null) {
- launcher.finish();
- }
- });
- waitForLauncherCondition(
- "Launcher still active", launcher -> launcher == null, DEFAULT_UI_TIMEOUT);
-
- // Start an activity where we'll press home.
- startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
+ closeLauncherActivity();
// The test action.
eventProcessor.startIteration();
@@ -58,7 +58,7 @@ public class RaceConditionsTests extends AbstractQuickStepTest {
@Test
@QuickstepOnOff(mode = Mode.ON)
- public void testPressHomeToStartLauncher() {
+ public void testPressHome() {
runTest(enterEvt(Launcher.ON_CREATE_EVT),
exitEvt(Launcher.ON_CREATE_EVT),
enterEvt(OtherActivityTouchConsumer.DOWN_EVT),
@@ -69,4 +69,11 @@ public class RaceConditionsTests extends AbstractQuickStepTest {
enterEvt(Launcher.ON_CREATE_EVT),
exitEvt(Launcher.ON_CREATE_EVT));
}
-}
+
+ @Test
+ @QuickstepOnOff(mode = Mode.ON)
+ public void testSwipeToOverview() {
+ closeLauncherActivity();
+ mLauncher.getBackground().switchToOverview();
+ }
+} \ No newline at end of file
diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
index 338fd853e..8c03e4b5f 100644
--- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
+++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java
@@ -347,4 +347,15 @@ public abstract class AbstractLauncherUiTest {
PackageManager.MATCH_SYSTEM_ONLY).
activityInfo.packageName;
}
+
+ protected void closeLauncherActivity() {
+ // Destroy Launcher activity.
+ executeOnLauncher(launcher -> {
+ if (launcher != null) {
+ launcher.finish();
+ }
+ });
+ waitForLauncherCondition(
+ "Launcher still active", launcher -> launcher == null, DEFAULT_UI_TIMEOUT);
+ }
}