Loading quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +34 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.quickstep; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ICON_MENU; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.TRANSIENT; Loading @@ -43,6 +44,7 @@ import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.OverviewActions; import com.android.launcher3.tapl.OverviewTask; import com.android.launcher3.tapl.OverviewTaskMenu; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.util.TestUtil; Loading Loading @@ -194,6 +196,38 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { actionsView.clickAndDismissScreenshot(); } @PlatinumTest(focusArea = "launcher") @Test public void testOverviewActionsMenu() throws Exception { startTestAppsWithCheck(); OverviewTaskMenu menu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertNotNull("Tapping App info menu item returned null", menu.tapAppInfoMenuItem()); executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top", isInLaunchedApp(launcher))); } @Test @ScreenRecord // b/303329286 public void testOverviewActionsMenu_iconAppChipMenu() throws Exception { try (AutoCloseable c = TestUtil.overrideFlag(ENABLE_OVERVIEW_ICON_MENU, true)) { startTestAppsWithCheck(); OverviewTaskMenu menu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertNotNull("Tapping App info menu item returned null", menu.tapAppInfoMenuItem()); executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the " + "top", isInLaunchedApp(launcher))); } } private int getCurrentOverviewPage(Launcher launcher) { return launcher.<RecentsView>getOverviewPanel().getCurrentPage(); } Loading quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java +39 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.quickstep; import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ICON_MENU; import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL; import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT; Loading @@ -30,8 +31,10 @@ import androidx.test.filters.LargeTest; import androidx.test.platform.app.InstrumentationRegistry; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.tapl.OverviewTaskMenu; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.rule.TestStabilityRule; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; Loading Loading @@ -139,6 +142,42 @@ public class TaplTestsSplitscreen extends AbstractQuickStepTest { .hasMenuItem("Save app pair")); } @Test public void testTapBothIconMenus() { createAndLaunchASplitPair(); OverviewTaskMenu taskMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertTrue("App info item not appearing in expanded task menu.", taskMenu.hasMenuItem("App info")); taskMenu.touchOutsideTaskMenuToDismiss(); OverviewTaskMenu splitMenu = mLauncher.getOverview().getCurrentTask().tapSplitTaskMenu(); assertTrue("App info item not appearing in expanded split task's menu.", splitMenu.hasMenuItem("App info")); splitMenu.touchOutsideTaskMenuToDismiss(); } @Test public void testTapBothIconMenus_iconAppChipMenu() throws Exception { try (AutoCloseable c = TestUtil.overrideFlag(ENABLE_OVERVIEW_ICON_MENU, true)) { createAndLaunchASplitPair(); OverviewTaskMenu taskMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertTrue("App info item not appearing in expanded task menu.", taskMenu.hasMenuItem("App info")); taskMenu.touchOutsideTaskMenuToDismiss(); OverviewTaskMenu splitMenu = mLauncher.getOverview().getCurrentTask().tapSplitTaskMenu(); assertTrue("App info item not appearing in expanded split task's menu.", splitMenu.hasMenuItem("App info")); splitMenu.touchOutsideTaskMenuToDismiss(); } } private void createAndLaunchASplitPair() { startTestActivity(2); startTestActivity(3); Loading src/com/android/launcher3/InvariantDeviceProfile.java +1 −3 Original line number Diff line number Diff line Loading @@ -486,9 +486,7 @@ public class InvariantDeviceProfile { iconBitmapSize, fillResIconDpi, numDatabaseAllAppsColumns, dbFile}; } /** Updates IDP using the provided context. Notifies listeners of change. */ @VisibleForTesting public void onConfigChanged(Context context) { private void onConfigChanged(Context context) { Object[] oldState = toModelState(); // Re-init grid Loading tests/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ filegroup { "src/com/android/launcher3/allapps/TaplOpenCloseAllApps.java", "src/com/android/launcher3/allapps/TaplTestsAllAppsIconsWorking.java", "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java", "src/com/android/launcher3/appiconmenu/TaplOverviewIconTest.java", "src/com/android/launcher3/dragging/TaplDragTest.java", "src/com/android/launcher3/dragging/TaplUninstallRemove.java", "src/com/android/launcher3/ui/AbstractLauncherUiTest.java", Loading tests/src/com/android/launcher3/appiconmenu/TaplOverviewIconAppChipMenuTest.javadeleted 100644 → 0 +0 −38 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.appiconmenu; import com.android.launcher3.Flags; import com.android.launcher3.InvariantDeviceProfile; import org.junit.Before; /** * Tests the Icon App Chip Menu in overview. * * <p>Same tests as TaplOverviewIconTest with the Flag FLAG_ENABLE_OVERVIEW_ICON_MENU enabled. * This class can be removed once FLAG_ENABLE_OVERVIEW_ICON_MENU is enabled by default. */ public class TaplOverviewIconAppChipMenuTest extends TaplOverviewIconTest { @Before public void setUp() throws Exception { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU); // Call before super.setUp super.setUp(); executeOnLauncher(launcher -> InvariantDeviceProfile.INSTANCE.get(launcher).onConfigChanged( launcher)); } } Loading
quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +34 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.quickstep; import static com.android.launcher3.config.FeatureFlags.ENABLE_CURSOR_HOVER_STATES; import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ICON_MENU; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.PERSISTENT; import static com.android.quickstep.TaskbarModeSwitchRule.Mode.TRANSIENT; Loading @@ -43,6 +44,7 @@ import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel; import com.android.launcher3.tapl.Overview; import com.android.launcher3.tapl.OverviewActions; import com.android.launcher3.tapl.OverviewTask; import com.android.launcher3.tapl.OverviewTaskMenu; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.util.TestUtil; Loading Loading @@ -194,6 +196,38 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest { actionsView.clickAndDismissScreenshot(); } @PlatinumTest(focusArea = "launcher") @Test public void testOverviewActionsMenu() throws Exception { startTestAppsWithCheck(); OverviewTaskMenu menu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertNotNull("Tapping App info menu item returned null", menu.tapAppInfoMenuItem()); executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the top", isInLaunchedApp(launcher))); } @Test @ScreenRecord // b/303329286 public void testOverviewActionsMenu_iconAppChipMenu() throws Exception { try (AutoCloseable c = TestUtil.overrideFlag(ENABLE_OVERVIEW_ICON_MENU, true)) { startTestAppsWithCheck(); OverviewTaskMenu menu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertNotNull("Tapping App info menu item returned null", menu.tapAppInfoMenuItem()); executeOnLauncher(launcher -> assertTrue( "Launcher activity is the top activity; expecting another activity to be the " + "top", isInLaunchedApp(launcher))); } } private int getCurrentOverviewPage(Launcher launcher) { return launcher.<RecentsView>getOverviewPanel().getCurrentPage(); } Loading
quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java +39 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.quickstep; import static com.android.launcher3.config.FeatureFlags.ENABLE_OVERVIEW_ICON_MENU; import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL; import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT; Loading @@ -30,8 +31,10 @@ import androidx.test.filters.LargeTest; import androidx.test.platform.app.InstrumentationRegistry; import com.android.launcher3.config.FeatureFlags; import com.android.launcher3.tapl.OverviewTaskMenu; import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.ui.TaplTestsLauncher3; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.rule.TestStabilityRule; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; Loading Loading @@ -139,6 +142,42 @@ public class TaplTestsSplitscreen extends AbstractQuickStepTest { .hasMenuItem("Save app pair")); } @Test public void testTapBothIconMenus() { createAndLaunchASplitPair(); OverviewTaskMenu taskMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertTrue("App info item not appearing in expanded task menu.", taskMenu.hasMenuItem("App info")); taskMenu.touchOutsideTaskMenuToDismiss(); OverviewTaskMenu splitMenu = mLauncher.getOverview().getCurrentTask().tapSplitTaskMenu(); assertTrue("App info item not appearing in expanded split task's menu.", splitMenu.hasMenuItem("App info")); splitMenu.touchOutsideTaskMenuToDismiss(); } @Test public void testTapBothIconMenus_iconAppChipMenu() throws Exception { try (AutoCloseable c = TestUtil.overrideFlag(ENABLE_OVERVIEW_ICON_MENU, true)) { createAndLaunchASplitPair(); OverviewTaskMenu taskMenu = mLauncher.goHome().switchToOverview().getCurrentTask().tapMenu(); assertTrue("App info item not appearing in expanded task menu.", taskMenu.hasMenuItem("App info")); taskMenu.touchOutsideTaskMenuToDismiss(); OverviewTaskMenu splitMenu = mLauncher.getOverview().getCurrentTask().tapSplitTaskMenu(); assertTrue("App info item not appearing in expanded split task's menu.", splitMenu.hasMenuItem("App info")); splitMenu.touchOutsideTaskMenuToDismiss(); } } private void createAndLaunchASplitPair() { startTestActivity(2); startTestActivity(3); Loading
src/com/android/launcher3/InvariantDeviceProfile.java +1 −3 Original line number Diff line number Diff line Loading @@ -486,9 +486,7 @@ public class InvariantDeviceProfile { iconBitmapSize, fillResIconDpi, numDatabaseAllAppsColumns, dbFile}; } /** Updates IDP using the provided context. Notifies listeners of change. */ @VisibleForTesting public void onConfigChanged(Context context) { private void onConfigChanged(Context context) { Object[] oldState = toModelState(); // Re-init grid Loading
tests/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ filegroup { "src/com/android/launcher3/allapps/TaplOpenCloseAllApps.java", "src/com/android/launcher3/allapps/TaplTestsAllAppsIconsWorking.java", "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java", "src/com/android/launcher3/appiconmenu/TaplOverviewIconTest.java", "src/com/android/launcher3/dragging/TaplDragTest.java", "src/com/android/launcher3/dragging/TaplUninstallRemove.java", "src/com/android/launcher3/ui/AbstractLauncherUiTest.java", Loading
tests/src/com/android/launcher3/appiconmenu/TaplOverviewIconAppChipMenuTest.javadeleted 100644 → 0 +0 −38 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.launcher3.appiconmenu; import com.android.launcher3.Flags; import com.android.launcher3.InvariantDeviceProfile; import org.junit.Before; /** * Tests the Icon App Chip Menu in overview. * * <p>Same tests as TaplOverviewIconTest with the Flag FLAG_ENABLE_OVERVIEW_ICON_MENU enabled. * This class can be removed once FLAG_ENABLE_OVERVIEW_ICON_MENU is enabled by default. */ public class TaplOverviewIconAppChipMenuTest extends TaplOverviewIconTest { @Before public void setUp() throws Exception { mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU); // Call before super.setUp super.setUp(); executeOnLauncher(launcher -> InvariantDeviceProfile.INSTANCE.get(launcher).onConfigChanged( launcher)); } }