[4/7]Add PlatinumTest annotation to tests am: 5bde3f8573

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23395253

Change-Id: I49ee16a06d53d7bc363a14ad7f8940a772e4e592
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Hui Kang
2023-05-25 16:33:38 +00:00
committed by Automerger Merge Worker
2 changed files with 21 additions and 0 deletions
@@ -26,6 +26,7 @@ import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue; import static org.junit.Assume.assumeTrue;
import android.content.Intent; import android.content.Intent;
import android.platform.test.annotations.PlatinumTest;
import androidx.test.filters.LargeTest; import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.platform.app.InstrumentationRegistry;
@@ -99,6 +100,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@NavigationModeSwitch @NavigationModeSwitch
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testWorkspaceSwitchToAllApps() { public void testWorkspaceSwitchToAllApps() {
assertNotNull("switchToAllApps() returned null", assertNotNull("switchToAllApps() returned null",
mLauncher.getWorkspace().switchToAllApps()); mLauncher.getWorkspace().switchToAllApps());
@@ -108,6 +110,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testOverview() throws Exception { public void testOverview() throws Exception {
startTestAppsWithCheck(); startTestAppsWithCheck();
// mLauncher.pressHome() also tests an important case of pressing home while in background. // mLauncher.pressHome() also tests an important case of pressing home while in background.
@@ -175,6 +178,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@NavigationModeSwitch @NavigationModeSwitch
@PortraitLandscape @PortraitLandscape
@ScreenRecord // b/195673272 @ScreenRecord // b/195673272
@PlatinumTest(focusArea = "launcher")
public void testOverviewActions() throws Exception { public void testOverviewActions() throws Exception {
// Experimenting for b/165029151: // Experimenting for b/165029151:
final Overview overview = mLauncher.goHome().switchToOverview(); final Overview overview = mLauncher.goHome().switchToOverview();
@@ -209,6 +213,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@NavigationModeSwitch @NavigationModeSwitch
@PortraitLandscape @PortraitLandscape
@ScreenRecord // b/238461765 @ScreenRecord // b/238461765
@PlatinumTest(focusArea = "launcher")
public void testSwitchToOverview() throws Exception { public void testSwitchToOverview() throws Exception {
startTestAppsWithCheck(); startTestAppsWithCheck();
assertNotNull("Workspace.switchToOverview() returned null", assertNotNull("Workspace.switchToOverview() returned null",
@@ -221,6 +226,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@NavigationModeSwitch @NavigationModeSwitch
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testBackground() throws Exception { public void testBackground() throws Exception {
startAppFast(CALCULATOR_APP_PACKAGE); startAppFast(CALCULATOR_APP_PACKAGE);
final LaunchedAppState launchedAppState = getAndAssertLaunchedApp(); final LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
@@ -275,6 +281,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@NavigationModeSwitch @NavigationModeSwitch
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testQuickSwitchFromApp() throws Exception { public void testQuickSwitchFromApp() throws Exception {
startTestActivity(2); startTestActivity(2);
startTestActivity(3); startTestActivity(3);
@@ -304,6 +311,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@ScreenRecord // b/242163205 @ScreenRecord // b/242163205
@PlatinumTest(focusArea = "launcher")
public void testQuickSwitchToPreviousAppForTablet() throws Exception { public void testQuickSwitchToPreviousAppForTablet() throws Exception {
assumeTrue(mLauncher.isTablet()); assumeTrue(mLauncher.isTablet());
startTestActivity(2); startTestActivity(2);
@@ -335,6 +343,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@NavigationModeSwitch @NavigationModeSwitch
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testQuickSwitchFromHome() throws Exception { public void testQuickSwitchFromHome() throws Exception {
startTestActivity(2); startTestActivity(2);
mLauncher.goHome().quickSwitchToPreviousApp(); mLauncher.goHome().quickSwitchToPreviousApp();
@@ -346,6 +355,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@NavigationModeSwitch @NavigationModeSwitch
@PlatinumTest(focusArea = "launcher")
public void testPressBack() throws Exception { public void testPressBack() throws Exception {
InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity( InstrumentationRegistry.getInstrumentation().getUiAutomation().adoptShellPermissionIdentity(
READ_DEVICE_CONFIG_PERMISSION); READ_DEVICE_CONFIG_PERMISSION);
@@ -364,6 +374,7 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@TaskbarModeSwitch(mode = PERSISTENT) @TaskbarModeSwitch(mode = PERSISTENT)
@PlatinumTest(focusArea = "launcher")
public void testOverviewForTablet() throws Exception { public void testOverviewForTablet() throws Exception {
assumeTrue(mLauncher.isTablet()); assumeTrue(mLauncher.isTablet());
@@ -32,6 +32,7 @@ import android.content.Intent;
import android.graphics.Point; import android.graphics.Point;
import android.os.SystemClock; import android.os.SystemClock;
import android.platform.test.annotations.IwTest; import android.platform.test.annotations.IwTest;
import android.platform.test.annotations.PlatinumTest;
import android.util.Log; import android.util.Log;
import androidx.test.filters.FlakyTest; import androidx.test.filters.FlakyTest;
@@ -350,6 +351,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testLaunchMenuItem() throws Exception { public void testLaunchMenuItem() throws Exception {
final AllApps allApps = mLauncher.getWorkspace().switchToAllApps(); final AllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze(); allApps.freeze();
@@ -394,6 +396,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testDragShortcut() throws Throwable { public void testDragShortcut() throws Throwable {
// 1. Open all apps and wait for load complete. // 1. Open all apps and wait for load complete.
// 2. Find the app and long press it to show shortcuts. // 2. Find the app and long press it to show shortcuts.
@@ -423,6 +426,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@PortraitLandscape @PortraitLandscape
@ScreenRecord @ScreenRecord
@Ignore // b/233075289 @Ignore // b/233075289
@PlatinumTest(focusArea = "launcher")
public void testDragToFolder() { public void testDragToFolder() {
// TODO: add the use case to drag an icon to an existing folder. Currently it either fails // TODO: add the use case to drag an icon to an existing folder. Currently it either fails
// on tablets or phones due to difference in resolution. // on tablets or phones due to difference in resolution.
@@ -469,6 +473,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testDragAndCancelAppIcon() { public void testDragAndCancelAppIcon() {
final HomeAppIcon homeAppIcon = createShortcutInCenterIfNotExist(GMAIL_APP_NAME); final HomeAppIcon homeAppIcon = createShortcutInCenterIfNotExist(GMAIL_APP_NAME);
Point positionBeforeDrag = Point positionBeforeDrag =
@@ -511,6 +516,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Ignore("b/256615483") @Ignore("b/256615483")
@Test @Test
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testUninstallFromWorkspace() throws Exception { public void testUninstallFromWorkspace() throws Exception {
installDummyAppAndWaitForUIUpdate(); installDummyAppAndWaitForUIUpdate();
try { try {
@@ -524,6 +530,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Test @Test
@ScreenRecord // b/258071914 @ScreenRecord // b/258071914
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testUninstallFromAllApps() throws Exception { public void testUninstallFromAllApps() throws Exception {
installDummyAppAndWaitForUIUpdate(); installDummyAppAndWaitForUIUpdate();
try { try {
@@ -539,6 +546,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testDragAppIconToWorkspaceCell() throws Exception { public void testDragAppIconToWorkspaceCell() throws Exception {
long startTime, endTime, elapsedTime; long startTime, endTime, elapsedTime;
Point[] targets = getCornersAndCenterPositions(); Point[] targets = getCornersAndCenterPositions();
@@ -574,6 +582,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Test @Test
@ScreenRecord // b/241821721 @ScreenRecord // b/241821721
@PlatinumTest(focusArea = "launcher")
public void getIconsPosition_afterIconRemoved_notContained() throws IOException { public void getIconsPosition_afterIconRemoved_notContained() throws IOException {
Point[] gridPositions = getCornersAndCenterPositions(); Point[] gridPositions = getCornersAndCenterPositions();
createShortcutIfNotExist(STORE_APP_NAME, gridPositions[0]); createShortcutIfNotExist(STORE_APP_NAME, gridPositions[0]);
@@ -600,6 +609,7 @@ public class TaplTestsLauncher3 extends AbstractLauncherUiTest {
@Test @Test
@PortraitLandscape @PortraitLandscape
@PlatinumTest(focusArea = "launcher")
public void testDragShortcutToWorkspaceCell() throws Exception { public void testDragShortcutToWorkspaceCell() throws Exception {
Point[] targets = getCornersAndCenterPositions(); Point[] targets = getCornersAndCenterPositions();