Add TaskbarModeSwitchRule to test both transient/persistent taskbar.
- Lays the foundation for transient taskbar tests. - Does not add flags that would add ACTION_OUTSIDE in tests. We can address testing this functionality in a separate CL Bug: 257549303 Test: TaplTestsTaskbar Change-Id: I44acc5e589b959e6d4bc93fdc369e503c54e7d87
This commit is contained in:
1 parent
cd587212a2
commit
d5a6b5f688
11 files changed
+247
-7
No files matched your search
@@ -17,6 +17,8 @@ package com.android.quickstep;
|
||||
|
||||
import static androidx.test.InstrumentationRegistry.getInstrumentation;
|
||||
|
||||
import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT;
|
||||
|
||||
import static junit.framework.TestCase.assertEquals;
|
||||
|
||||
import android.content.Intent;
|
||||
@@ -27,6 +29,7 @@ import androidx.test.runner.AndroidJUnit4;
|
||||
import com.android.launcher3.tapl.Taskbar;
|
||||
import com.android.launcher3.ui.TaplTestsLauncher3;
|
||||
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
|
||||
import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Assume;
|
||||
@@ -53,21 +56,25 @@ public class TaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
TaplTestsLauncher3.initialize(this);
|
||||
|
||||
startAppFast(CALCULATOR_APP_PACKAGE);
|
||||
mLauncher.enableBlockTimeout(true);
|
||||
mLauncher.showTaskbarIfHidden();
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
mLauncher.useDefaultWorkspaceLayoutOnReload();
|
||||
mLauncher.enableBlockTimeout(false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch(mode = PERSISTENT)
|
||||
public void testHideShowTaskbar() {
|
||||
getTaskbar().hide();
|
||||
mLauncher.getLaunchedAppState().showTaskbar();
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch(mode = PERSISTENT)
|
||||
public void testHideTaskbarPersistsOnRecreate() {
|
||||
getTaskbar().hide();
|
||||
mLauncher.recreateTaskbar();
|
||||
@@ -75,16 +82,19 @@ public class TaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchApp() throws Exception {
|
||||
getTaskbar().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch
|
||||
public void testOpenMenu() throws Exception {
|
||||
getTaskbar().getAppIcon(TEST_APP_NAME).openMenu();
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchShortcut() throws Exception {
|
||||
getTaskbar().getAppIcon(TEST_APP_NAME)
|
||||
.openDeepShortcutMenu()
|
||||
@@ -95,6 +105,7 @@ public class TaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
@Test
|
||||
@ScreenRecord // b/231615831
|
||||
@PortraitLandscape
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchAppInSplitscreen() throws Exception {
|
||||
getTaskbar().getAppIcon(TEST_APP_NAME).dragToSplitscreen(
|
||||
TEST_APP_PACKAGE, CALCULATOR_APP_PACKAGE);
|
||||
@@ -103,6 +114,7 @@ public class TaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
@Test
|
||||
@ScreenRecord // b/231615831
|
||||
@PortraitLandscape
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchShortcutInSplitscreen() throws Exception {
|
||||
getTaskbar().getAppIcon(TEST_APP_NAME)
|
||||
.openDeepShortcutMenu()
|
||||
@@ -111,16 +123,19 @@ public class TaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchApp_FromTaskbarAllApps() throws Exception {
|
||||
getTaskbar().openAllApps().getAppIcon(TEST_APP_NAME).launch(TEST_APP_PACKAGE);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch
|
||||
public void testOpenMenu_FromTaskbarAllApps() throws Exception {
|
||||
getTaskbar().openAllApps().getAppIcon(TEST_APP_NAME).openMenu();
|
||||
}
|
||||
|
||||
@Test
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchShortcut_FromTaskbarAllApps() throws Exception {
|
||||
getTaskbar().openAllApps()
|
||||
.getAppIcon(TEST_APP_NAME)
|
||||
@@ -132,6 +147,7 @@ public class TaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
@Test
|
||||
@ScreenRecord // b/231615831
|
||||
@PortraitLandscape
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchAppInSplitscreen_FromTaskbarAllApps() throws Exception {
|
||||
getTaskbar().openAllApps()
|
||||
.getAppIcon(TEST_APP_NAME)
|
||||
@@ -141,6 +157,7 @@ public class TaplTestsTaskbar extends AbstractQuickStepTest {
|
||||
@Test
|
||||
@ScreenRecord // b/231615831
|
||||
@PortraitLandscape
|
||||
@TaskbarModeSwitch
|
||||
public void testLaunchShortcutInSplitscreen_FromTaskbarAllApps() throws Exception {
|
||||
getTaskbar().openAllApps()
|
||||
.getAppIcon(TEST_APP_NAME)
|
||||
|
||||
Reference in new issue
Block a user