From fc8537d5de075394e7ce607a3c997a2a66801611 Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Mon, 28 Apr 2025 18:31:10 -0700 Subject: [PATCH] Creating NexusLauncherE2ETests test suite, this cl only adds the Launcher3 part The test don't run yet in presubmit, first I will have the NexusLauncherE2ETests target ready and then I will add it to the presubmit. Bug: 324261526 Flag: EXEMPT test only Test: atest NexusLauncherE2ETests Change-Id: I4daa204ec735456c481b0682ca518da381af7bb7 --- .../quickstep/AbstractQuickStepTest.java | 2 +- .../quickstep/AbstractTaplTestsTaskbar.java | 2 +- .../quickstep/FallbackRecentsTest.java | 12 ++-- .../quickstep/NavigationModeSwitchRule.java | 2 +- .../quickstep/TaplTestsLockedTaskbar.java | 2 +- .../quickstep/TaplTestsOverviewDesktop.kt | 2 +- .../android/quickstep/TaplTestsQuickstep.java | 2 +- .../android/quickstep/TaplTestsTaskbar.java | 2 +- .../android/quickstep/TaplTestsTrackpad.java | 2 +- .../quickstep/TaskbarModeSwitchRule.java | 2 +- .../quickstep/util/SplitScreenTestUtils.kt | 2 +- .../util/SplitSelectDataHolderTest.kt | 46 +++++++-------- tests/Android.bp | 12 +--- .../src/com/android/launcher3/Android.bp | 15 +++++ .../celllayout/board/TestWorkspaceBuilder.kt | 4 +- .../{ => util}/ui/TestViewHelpers.java | 2 +- .../workspace}/FavoriteItemsTransaction.java | 2 +- tests/src/com/android/launcher3/Android.bp | 59 +++++++++++++++++++ .../allapps/TaplAllAppsIconsWorkingTest.java | 4 +- .../allapps/TaplOpenCloseAllAppsTest.java | 4 +- .../{ui => allapps}/WorkProfileTest.java | 7 +-- .../appiconmenu/TaplAppIconMenuTest.java | 4 +- .../launcher3/dragging/TaplDragTest.java | 4 +- .../dragging/TaplUninstallRemoveTest.java | 4 +- .../IntegrationReorderWidgetsTest.kt | 2 +- .../DoubleShadowIconDrawableTest.kt | 8 +-- .../android/launcher3/model/LoaderTaskTest.kt | 2 +- .../launcher3/{ui => model}/ShadowInfoTest.kt | 4 +- .../launcher3/ui/TaplTestsLauncher3Test.java | 4 +- .../launcher3/util/ItemInflaterTest.kt | 2 +- .../launcher3/util/rule/FailureWatcher.java | 2 +- .../util/rule/TestIsolationRule.java | 2 +- .../{ => util}/ui/AbstractLauncherUiTest.java | 2 +- .../{ => util}/ui/BaseLauncherTaplTest.java | 4 +- .../ui/PortraitLandscapeRunner.java | 18 +++++- .../util/viewcapture_analysis/Android.bp | 10 ++++ .../{ui => }/widget/AddConfigWidgetTest.java | 11 ++-- .../{ui => }/widget/BindWidgetTest.java | 10 +--- .../{ui => }/widget/RequestPinItemTest.java | 4 +- .../{ui => }/widget/TaplAddWidgetTest.java | 11 ++-- .../picker}/WidgetPickerTest.java | 6 +- .../workspace/TaplTwoPanelWorkspaceTest.java | 8 +-- .../{ui => }/workspace/TaplWorkspaceTest.java | 4 +- .../{ui => }/workspace/ThemeIconsTest.java | 4 +- 44 files changed, 199 insertions(+), 118 deletions(-) create mode 100644 tests/multivalentTests/src/com/android/launcher3/Android.bp rename tests/multivalentTests/src/com/android/launcher3/{ => util}/ui/TestViewHelpers.java (98%) rename tests/multivalentTests/src/com/android/launcher3/{celllayout => util/workspace}/FavoriteItemsTransaction.java (98%) create mode 100644 tests/src/com/android/launcher3/Android.bp rename tests/src/com/android/launcher3/{ui => allapps}/WorkProfileTest.java (96%) rename tests/src/com/android/launcher3/{ui => model}/DoubleShadowIconDrawableTest.kt (97%) rename tests/src/com/android/launcher3/{ui => model}/ShadowInfoTest.kt (97%) rename tests/src/com/android/launcher3/{ => util}/ui/AbstractLauncherUiTest.java (99%) rename tests/src/com/android/launcher3/{ => util}/ui/BaseLauncherTaplTest.java (99%) rename tests/src/com/android/launcher3/{ => util}/ui/PortraitLandscapeRunner.java (87%) create mode 100644 tests/src/com/android/launcher3/util/viewcapture_analysis/Android.bp rename tests/src/com/android/launcher3/{ui => }/widget/AddConfigWidgetTest.java (94%) rename tests/src/com/android/launcher3/{ui => }/widget/BindWidgetTest.java (96%) rename tests/src/com/android/launcher3/{ui => }/widget/RequestPinItemTest.java (98%) rename tests/src/com/android/launcher3/{ui => }/widget/TaplAddWidgetTest.java (92%) rename tests/src/com/android/launcher3/{ui/widget => widget/picker}/WidgetPickerTest.java (93%) rename tests/src/com/android/launcher3/{ui => }/workspace/TaplTwoPanelWorkspaceTest.java (98%) rename tests/src/com/android/launcher3/{ui => }/workspace/TaplWorkspaceTest.java (98%) rename tests/src/com/android/launcher3/{ui => }/workspace/ThemeIconsTest.java (98%) diff --git a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java index 168355b1c0..86c439c1ee 100644 --- a/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java +++ b/quickstep/tests/src/com/android/quickstep/AbstractQuickStepTest.java @@ -29,10 +29,10 @@ import androidx.test.uiautomator.Until; import com.android.launcher3.LauncherState; import com.android.launcher3.tapl.LaunchedAppState; import com.android.launcher3.tapl.TestHelpers; -import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.Wait; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.fallback.window.RecentsWindowManager; import com.android.quickstep.views.RecentsView; diff --git a/quickstep/tests/src/com/android/quickstep/AbstractTaplTestsTaskbar.java b/quickstep/tests/src/com/android/quickstep/AbstractTaplTestsTaskbar.java index 0ccc76b24e..a3a12bfba0 100644 --- a/quickstep/tests/src/com/android/quickstep/AbstractTaplTestsTaskbar.java +++ b/quickstep/tests/src/com/android/quickstep/AbstractTaplTestsTaskbar.java @@ -24,10 +24,10 @@ import android.content.Intent; import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.tapl.Taskbar; -import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.LauncherLayoutBuilder; import com.android.launcher3.util.TestUtil; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; import org.junit.After; import org.junit.Assume; diff --git a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java index 6a28a974e4..c9d8860b28 100644 --- a/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java +++ b/quickstep/tests/src/com/android/quickstep/FallbackRecentsTest.java @@ -23,14 +23,14 @@ import static androidx.test.InstrumentationRegistry.getInstrumentation; import static com.android.launcher3.tapl.LauncherInstrumentation.WAIT_TIME_MS; import static com.android.launcher3.tapl.TestHelpers.getHomeIntentInPackage; import static com.android.launcher3.tapl.TestHelpers.getLauncherInMyProcess; -import static com.android.launcher3.ui.AbstractLauncherUiTest.DEFAULT_BROADCAST_TIMEOUT_SECS; -import static com.android.launcher3.ui.AbstractLauncherUiTest.resolveSystemApp; -import static com.android.launcher3.ui.AbstractLauncherUiTest.startAppFast; -import static com.android.launcher3.ui.AbstractLauncherUiTest.startTestActivity; -import static com.android.launcher3.ui.TaplTestsLauncher3Test.getAppPackageName; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.rule.ShellCommandRule.disableHeadsUpNotification; import static com.android.launcher3.util.rule.ShellCommandRule.getLauncherCommand; +import static com.android.launcher3.util.ui.AbstractLauncherUiTest.DEFAULT_BROADCAST_TIMEOUT_SECS; +import static com.android.launcher3.util.ui.AbstractLauncherUiTest.resolveSystemApp; +import static com.android.launcher3.util.ui.AbstractLauncherUiTest.startAppFast; +import static com.android.launcher3.util.ui.AbstractLauncherUiTest.startTestActivity; +import static com.android.launcher3.ui.TaplTestsLauncher3Test.getAppPackageName; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -55,7 +55,6 @@ import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.tapl.OverviewTask; import com.android.launcher3.tapl.TestHelpers; import com.android.launcher3.testcomponent.TestCommandReceiver; -import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.FailureWatcher; @@ -65,6 +64,7 @@ import com.android.launcher3.util.rule.ScreenRecordRule; import com.android.launcher3.util.rule.TestIsolationRule; import com.android.launcher3.util.rule.TestStabilityRule; import com.android.launcher3.util.rule.ViewCaptureRule; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; import com.android.quickstep.OverviewComponentObserver.OverviewChangeListener; import com.android.quickstep.fallback.window.RecentsWindowFlags; import com.android.quickstep.fallback.window.RecentsWindowManager; diff --git a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java index ef7183fc88..212f933798 100644 --- a/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java +++ b/quickstep/tests/src/com/android/quickstep/NavigationModeSwitchRule.java @@ -33,10 +33,10 @@ import androidx.test.uiautomator.UiDevice; import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.tapl.TestHelpers; -import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.FailureWatcher; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; import com.android.systemui.shared.system.QuickStepContract; import org.junit.rules.TestRule; diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsLockedTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsLockedTaskbar.java index b2617dd803..1f0bf35f48 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsLockedTaskbar.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsLockedTaskbar.java @@ -35,8 +35,8 @@ import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.tapl.HomeAllApps; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.rule.SetPropRule; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; import com.android.window.flags.Flags; diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsOverviewDesktop.kt b/quickstep/tests/src/com/android/quickstep/TaplTestsOverviewDesktop.kt index 8c02340ce0..d68a50e9e4 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsOverviewDesktop.kt +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsOverviewDesktop.kt @@ -23,8 +23,8 @@ import androidx.test.uiautomator.Until import com.android.launcher3.BuildConfig import com.android.launcher3.tapl.LaunchedAppState import com.android.launcher3.tapl.OverviewTask -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape import com.android.launcher3.util.TestUtil +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape import com.google.common.truth.Truth.assertWithMessage import org.junit.Before import org.junit.Test diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java index 560a28c1f2..8c92f3ecda 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java @@ -47,10 +47,10 @@ import com.android.launcher3.tapl.OverviewActions; import com.android.launcher3.tapl.OverviewTask; import com.android.launcher3.tapl.SelectModeButtons; import com.android.launcher3.tapl.Workspace; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.ScreenRecordRule; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch; import com.android.quickstep.views.RecentsView; diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java index ec245ee0f3..0d1d2bd16c 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTaskbar.java @@ -23,7 +23,7 @@ import static com.android.quickstep.TaplTestsTaskbar.TaskbarMode.TRANSIENT; import androidx.test.filters.LargeTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java index 710ad6f6dc..8cb1c622df 100644 --- a/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java +++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java @@ -29,7 +29,7 @@ import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.tapl.LauncherInstrumentation.TrackpadGestureType; import com.android.launcher3.tapl.Workspace; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch; import org.junit.After; diff --git a/quickstep/tests/src/com/android/quickstep/TaskbarModeSwitchRule.java b/quickstep/tests/src/com/android/quickstep/TaskbarModeSwitchRule.java index 84ceb332d9..87cda25c3c 100644 --- a/quickstep/tests/src/com/android/quickstep/TaskbarModeSwitchRule.java +++ b/quickstep/tests/src/com/android/quickstep/TaskbarModeSwitchRule.java @@ -27,9 +27,9 @@ import android.util.Log; import com.android.launcher3.tapl.LauncherInstrumentation; import com.android.launcher3.tapl.TestHelpers; -import com.android.launcher3.ui.AbstractLauncherUiTest; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.rule.FailureWatcher; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; import org.junit.rules.TestRule; import org.junit.runner.Description; diff --git a/quickstep/tests/src/com/android/quickstep/util/SplitScreenTestUtils.kt b/quickstep/tests/src/com/android/quickstep/util/SplitScreenTestUtils.kt index 99c74bec15..15fa84c6b1 100644 --- a/quickstep/tests/src/com/android/quickstep/util/SplitScreenTestUtils.kt +++ b/quickstep/tests/src/com/android/quickstep/util/SplitScreenTestUtils.kt @@ -20,7 +20,7 @@ import androidx.test.uiautomator.By import com.android.launcher3.tapl.LauncherInstrumentation import com.android.launcher3.tapl.Overview import com.android.launcher3.tapl.OverviewTask -import com.android.launcher3.ui.AbstractLauncherUiTest +import com.android.launcher3.util.ui.AbstractLauncherUiTest object SplitScreenTestUtils { diff --git a/quickstep/tests/src/com/android/quickstep/util/SplitSelectDataHolderTest.kt b/quickstep/tests/src/com/android/quickstep/util/SplitSelectDataHolderTest.kt index dfb48d1dca..faac190bec 100644 --- a/quickstep/tests/src/com/android/quickstep/util/SplitSelectDataHolderTest.kt +++ b/quickstep/tests/src/com/android/quickstep/util/SplitSelectDataHolderTest.kt @@ -27,8 +27,8 @@ import android.os.UserHandle import androidx.test.platform.app.InstrumentationRegistry import com.android.launcher3.model.data.ItemInfo import com.android.launcher3.shortcuts.ShortcutKey -import com.android.launcher3.ui.AbstractLauncherUiTest import com.android.launcher3.util.SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT +import com.android.launcher3.util.ui.AbstractLauncherUiTest import com.android.quickstep.util.SplitSelectDataHolder.Companion.SPLIT_PENDINGINTENT_PENDINGINTENT import com.android.quickstep.util.SplitSelectDataHolder.Companion.SPLIT_PENDINGINTENT_TASK import com.android.quickstep.util.SplitSelectDataHolder.Companion.SPLIT_SHORTCUT_TASK @@ -85,7 +85,7 @@ class SplitSelectDataHolderTest { sampleTaskInfo, STAGE_POSITION_TOP_OR_LEFT, null, - null + null, ) assertTrue(splitSelectDataHolder.isSplitSelectActive()) } @@ -97,7 +97,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) assertTrue(splitSelectDataHolder.isSplitSelectActive()) } @@ -109,7 +109,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - sampleTaskId + sampleTaskId, ) assertTrue(splitSelectDataHolder.isSplitSelectActive()) } @@ -121,7 +121,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) assertTrue(splitSelectDataHolder.isSplitSelectActive()) } @@ -133,7 +133,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) splitSelectDataHolder.setSecondTask(sampleTaskId, sampleItemInfo2) assertTrue(splitSelectDataHolder.isBothSplitAppsConfirmed()) @@ -145,7 +145,7 @@ class SplitSelectDataHolderTest { sampleTaskInfo, STAGE_POSITION_TOP_OR_LEFT, null, - null + null, ) splitSelectDataHolder.setSecondTask(sampleIntent, sampleUser, sampleItemInfo2) assertTrue(splitSelectDataHolder.isBothSplitAppsConfirmed()) @@ -158,7 +158,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) splitSelectDataHolder.setSecondTask(sampleShortcut, sampleUser, sampleItemInfo2) assertTrue(splitSelectDataHolder.isBothSplitAppsConfirmed()) @@ -170,7 +170,7 @@ class SplitSelectDataHolderTest { sampleTaskInfo, STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, - null + null, ) splitSelectDataHolder.setSecondTask(sampleTaskId2, sampleItemInfo2) val launchData = splitSelectDataHolder.getSplitLaunchData() @@ -194,7 +194,7 @@ class SplitSelectDataHolderTest { sampleTaskInfo, STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, - null + null, ) splitSelectDataHolder.setSecondTask(sampleIntent, sampleUser, sampleItemInfo2) val launchData = splitSelectDataHolder.getSplitLaunchData() @@ -218,7 +218,7 @@ class SplitSelectDataHolderTest { sampleTaskInfo, STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, - null + null, ) splitSelectDataHolder.setSecondTask(sampleShortcut, sampleUser, sampleItemInfo2) val launchData = splitSelectDataHolder.getSplitLaunchData() @@ -243,7 +243,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) splitSelectDataHolder.setSecondTask(sampleTaskId, sampleItemInfo2) val launchData = splitSelectDataHolder.getSplitLaunchData() @@ -268,7 +268,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) splitSelectDataHolder.setSecondTask(sampleTaskId, sampleItemInfo2) val launchData = splitSelectDataHolder.getSplitLaunchData() @@ -293,7 +293,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) splitSelectDataHolder.setSecondTask(sampleIntent2, sampleUser, sampleItemInfo2) val launchData = splitSelectDataHolder.getSplitLaunchData() @@ -317,7 +317,7 @@ class SplitSelectDataHolderTest { sampleTaskInfo, STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, - null + null, ) val launchData = splitSelectDataHolder.getFullscreenLaunchData() @@ -341,7 +341,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) val launchData = splitSelectDataHolder.getFullscreenLaunchData() @@ -365,7 +365,7 @@ class SplitSelectDataHolderTest { STAGE_POSITION_TOP_OR_LEFT, sampleItemInfo, null, - INVALID_TASK_ID + INVALID_TASK_ID, ) val launchData = splitSelectDataHolder.getFullscreenLaunchData() @@ -388,7 +388,7 @@ class SplitSelectDataHolderTest { sampleTaskInfo, STAGE_POSITION_TOP_OR_LEFT, null, - null + null, ) splitSelectDataHolder.setSecondTask(sampleIntent, sampleUser, sampleItemInfo2) splitSelectDataHolder.resetState() @@ -398,11 +398,11 @@ class SplitSelectDataHolderTest { @Test fun clearState_intent() { splitSelectDataHolder.setInitialTaskSelect( - sampleIntent, - STAGE_POSITION_TOP_OR_LEFT, - sampleItemInfo, - null, - INVALID_TASK_ID + sampleIntent, + STAGE_POSITION_TOP_OR_LEFT, + sampleItemInfo, + null, + INVALID_TASK_ID, ) splitSelectDataHolder.setSecondTask(sampleIntent, sampleUser, sampleItemInfo2) splitSelectDataHolder.resetState() diff --git a/tests/Android.bp b/tests/Android.bp index fc08e86284..e2698dab21 100644 --- a/tests/Android.bp +++ b/tests/Android.bp @@ -57,13 +57,7 @@ filegroup { name: "launcher-oop-tests-src", srcs: [ ":launcher-testing-helpers", - "src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java", - "src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java", - "src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java", - "src/com/android/launcher3/dragging/TaplDragTest.java", - "src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java", - "src/com/android/launcher3/ui/TaplTestsLauncher3Test.java", - "src/com/android/launcher3/ui/workspace/TaplWorkspaceTest.java", + ":launcher-oop-tests-only", ], } @@ -158,8 +152,8 @@ filegroup { "src/**/*.kt", "multivalentTests/src/**/*.java", "multivalentTests/src/**/*.kt", - "src/com/android/launcher3/ui/AbstractLauncherUiTest.java", - "src/com/android/launcher3/ui/BaseLauncherTaplTest.java", + "src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java", + "src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java", "tapl/com/android/launcher3/tapl/*.java", "tapl/com/android/launcher3/tapl/*.kt", ], diff --git a/tests/multivalentTests/src/com/android/launcher3/Android.bp b/tests/multivalentTests/src/com/android/launcher3/Android.bp new file mode 100644 index 0000000000..189ec96bb8 --- /dev/null +++ b/tests/multivalentTests/src/com/android/launcher3/Android.bp @@ -0,0 +1,15 @@ +filegroup { + name: "launcher-shared-tests-utils", + srcs: [ + "testcomponent/AppWidgetDynamicColors.java", + "testcomponent/AppWidgetHidden.java", + "testcomponent/AppWidgetNoConfig.java", + "testcomponent/AppWidgetWithConfig.java", + "testcomponent/TouchEventGenerator.java", + "util/ModelTestExtensions.kt", + "util/rule/TestStabilityRule.java", + "util/TestUtil.java", + "util/ui/TestViewHelpers.java", + "util/workspace/FavoriteItemsTransaction.java", + ], +} diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt index 3405cae355..f58fd468eb 100644 --- a/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt +++ b/tests/multivalentTests/src/com/android/launcher3/celllayout/board/TestWorkspaceBuilder.kt @@ -25,13 +25,13 @@ import androidx.test.core.app.ApplicationProvider import androidx.test.platform.app.InstrumentationRegistry import com.android.launcher3.InvariantDeviceProfile import com.android.launcher3.LauncherSettings -import com.android.launcher3.celllayout.FavoriteItemsTransaction import com.android.launcher3.model.data.AppInfo import com.android.launcher3.model.data.FolderInfo import com.android.launcher3.model.data.ItemInfo import com.android.launcher3.model.data.WorkspaceItemInfo -import com.android.launcher3.ui.TestViewHelpers import com.android.launcher3.util.WidgetUtils +import com.android.launcher3.util.ui.TestViewHelpers +import com.android.launcher3.util.workspace.FavoriteItemsTransaction import java.util.function.Supplier class TestWorkspaceBuilder(private val mContext: Context) { diff --git a/tests/multivalentTests/src/com/android/launcher3/ui/TestViewHelpers.java b/tests/multivalentTests/src/com/android/launcher3/util/ui/TestViewHelpers.java similarity index 98% rename from tests/multivalentTests/src/com/android/launcher3/ui/TestViewHelpers.java rename to tests/multivalentTests/src/com/android/launcher3/util/ui/TestViewHelpers.java index 4b2bade452..c7c2cd7ef0 100644 --- a/tests/multivalentTests/src/com/android/launcher3/ui/TestViewHelpers.java +++ b/tests/multivalentTests/src/com/android/launcher3/util/ui/TestViewHelpers.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.android.launcher3.ui; +package com.android.launcher3.util.ui; import static android.os.Process.myUserHandle; diff --git a/tests/multivalentTests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java b/tests/multivalentTests/src/com/android/launcher3/util/workspace/FavoriteItemsTransaction.java similarity index 98% rename from tests/multivalentTests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java rename to tests/multivalentTests/src/com/android/launcher3/util/workspace/FavoriteItemsTransaction.java index f7723392d4..c4e0624e3a 100644 --- a/tests/multivalentTests/src/com/android/launcher3/celllayout/FavoriteItemsTransaction.java +++ b/tests/multivalentTests/src/com/android/launcher3/util/workspace/FavoriteItemsTransaction.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.launcher3.celllayout; +package com.android.launcher3.util.workspace; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MODEL_EXECUTOR; diff --git a/tests/src/com/android/launcher3/Android.bp b/tests/src/com/android/launcher3/Android.bp new file mode 100644 index 0000000000..f40c027ba4 --- /dev/null +++ b/tests/src/com/android/launcher3/Android.bp @@ -0,0 +1,59 @@ +// Should only contain test files, no utility classes +filegroup { + name: "launcher-e2e-tests-only", + srcs: [ + "allapps/TaplAllAppsIconsWorkingTest.java", + "allapps/TaplOpenCloseAllAppsTest.java", + "appiconmenu/TaplAppIconMenuTest.java", + "dragging/TaplDragTest.java", + "dragging/TaplUninstallRemoveTest.java", + "tapl/TaplUtilityTest.java", + "widget/TaplAddWidgetTest.java", + "ui/TaplTestsLauncher3Test.java", + "workspace/TaplTwoPanelWorkspaceTest.java", + "workspace/TaplWorkspaceTest.java", + ], +} + +filegroup { + name: "launcher-e2e-tests-utils", + srcs: [ + "testcomponent/TestCommandReceiver.java", + "util/TestConstants.java", + "util/Wait.kt", + "util/rule/FailureWatcher.java", + "util/rule/MutualExclusionRule.java", + "util/rule/SamplerRule.java", + "util/rule/ScreenRecordRule.java", + "util/rule/ShellCommandRule.java", + "util/rule/ViewCaptureRule.kt", + "util/rule/TestIsolationRule.java", + "util/ui/AbstractLauncherUiTest.java", + "util/ui/BaseLauncherTaplTest.java", + "util/ui/PortraitLandscapeRunner.java", + ], +} + +// Combination of tests and utils in the launcher3 package +filegroup { + name: "launcher-e2e-tests", + srcs: [ + ":launcher-e2e-tests-only", + ":launcher-e2e-tests-utils", + ":launcher-viewcapture-analysis", + ], +} + +// TODO(b/324261526) After the bug is completed this file group should not exists anymore +filegroup { + name: "launcher-oop-tests-only", + srcs: [ + "allapps/TaplAllAppsIconsWorkingTest.java", + "allapps/TaplOpenCloseAllAppsTest.java", + "appiconmenu/TaplAppIconMenuTest.java", + "dragging/TaplDragTest.java", + "dragging/TaplUninstallRemoveTest.java", + "ui/TaplTestsLauncher3Test.java", + "workspace/TaplWorkspaceTest.java", + ], +} diff --git a/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java b/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java index 1b2b8dcc9d..6be4850c46 100644 --- a/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java +++ b/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java @@ -24,8 +24,8 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.tapl.AppIcon; import com.android.launcher3.tapl.HomeAllApps; -import com.android.launcher3.ui.AbstractLauncherUiTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import org.junit.Test; diff --git a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java index 5274631845..4bc7138e28 100644 --- a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java +++ b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java @@ -31,8 +31,8 @@ import androidx.test.platform.app.InstrumentationRegistry; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.tapl.AllApps; -import com.android.launcher3.ui.AbstractLauncherUiTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import org.junit.Test; diff --git a/tests/src/com/android/launcher3/ui/WorkProfileTest.java b/tests/src/com/android/launcher3/allapps/WorkProfileTest.java similarity index 96% rename from tests/src/com/android/launcher3/ui/WorkProfileTest.java rename to tests/src/com/android/launcher3/allapps/WorkProfileTest.java index c191760f5d..b625e6d2cb 100644 --- a/tests/src/com/android/launcher3/ui/WorkProfileTest.java +++ b/tests/src/com/android/launcher3/allapps/WorkProfileTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.launcher3.ui; +package com.android.launcher3.allapps; import static com.android.launcher3.LauncherPrefs.WORK_EDU_STEP; import static com.android.launcher3.LauncherState.ALL_APPS; @@ -37,11 +37,6 @@ import androidx.test.filters.LargeTest; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherPrefs; import com.android.launcher3.R; -import com.android.launcher3.allapps.ActivityAllAppsContainerView; -import com.android.launcher3.allapps.AllAppsPagedView; -import com.android.launcher3.allapps.WorkEduCard; -import com.android.launcher3.allapps.WorkPausedCard; -import com.android.launcher3.allapps.WorkProfileManager; import com.android.launcher3.util.BaseLauncherActivityTest; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.rule.ScreenRecordRule; diff --git a/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java b/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java index bd573820dc..3a7232ca9d 100644 --- a/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java +++ b/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java @@ -29,8 +29,8 @@ import com.android.launcher3.tapl.AllApps; import com.android.launcher3.tapl.AppIconMenu; import com.android.launcher3.tapl.AppIconMenuItem; import com.android.launcher3.tapl.HomeAllApps; -import com.android.launcher3.ui.AbstractLauncherUiTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import org.junit.Test; diff --git a/tests/src/com/android/launcher3/dragging/TaplDragTest.java b/tests/src/com/android/launcher3/dragging/TaplDragTest.java index bf47026760..d7ce08acd4 100644 --- a/tests/src/com/android/launcher3/dragging/TaplDragTest.java +++ b/tests/src/com/android/launcher3/dragging/TaplDragTest.java @@ -38,10 +38,10 @@ import com.android.launcher3.tapl.HomeAllApps; import com.android.launcher3.tapl.HomeAppIcon; import com.android.launcher3.tapl.HomeAppIconMenuItem; import com.android.launcher3.tapl.Workspace; -import com.android.launcher3.ui.AbstractLauncherUiTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.rule.ScreenRecordRule; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import org.junit.Test; diff --git a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java index 459db73650..7443a9a46e 100644 --- a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java +++ b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java @@ -34,10 +34,10 @@ import com.android.launcher3.Launcher; import com.android.launcher3.tapl.HomeAllApps; import com.android.launcher3.tapl.HomeAppIcon; import com.android.launcher3.tapl.Workspace; -import com.android.launcher3.ui.AbstractLauncherUiTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.Wait; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import org.junit.Test; diff --git a/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt b/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt index b5f4fa26a8..813225ccad 100644 --- a/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt +++ b/tests/src/com/android/launcher3/integration/celllayout/IntegrationReorderWidgetsTest.kt @@ -33,7 +33,6 @@ import com.android.launcher3.celllayout.CellLayoutTestCaseReader import com.android.launcher3.celllayout.CellLayoutTestCaseReader.Board import com.android.launcher3.celllayout.CellLayoutTestCaseReader.TestSection import com.android.launcher3.celllayout.CellLayoutTestUtils -import com.android.launcher3.celllayout.FavoriteItemsTransaction import com.android.launcher3.celllayout.ReorderTestCase import com.android.launcher3.celllayout.board.CellLayoutBoard import com.android.launcher3.celllayout.board.TestWorkspaceBuilder @@ -53,6 +52,7 @@ import com.android.launcher3.util.ModelTestExtensions.clearModelDb import com.android.launcher3.util.rule.ScreenRecordRule import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord import com.android.launcher3.util.rule.ShellCommandRule +import com.android.launcher3.util.workspace.FavoriteItemsTransaction import com.android.launcher3.widget.LauncherAppWidgetHostView import kotlin.math.abs import kotlin.math.roundToInt diff --git a/tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt b/tests/src/com/android/launcher3/model/DoubleShadowIconDrawableTest.kt similarity index 97% rename from tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt rename to tests/src/com/android/launcher3/model/DoubleShadowIconDrawableTest.kt index 1cee71c219..45fef14a9c 100644 --- a/tests/src/com/android/launcher3/ui/DoubleShadowIconDrawableTest.kt +++ b/tests/src/com/android/launcher3/model/DoubleShadowIconDrawableTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.launcher3.ui +package com.android.launcher3.model import android.graphics.Color import android.graphics.drawable.Drawable @@ -58,7 +58,7 @@ class DoubleShadowIconDrawableTest { keyShadowBlur = 3f, keyShadowOffsetX = 4f, keyShadowOffsetY = 5f, - keyShadowColor = 6 + keyShadowColor = 6, ) val originalDrawable: Drawable = mock() val iconSize = 2 @@ -73,14 +73,14 @@ class DoubleShadowIconDrawableTest { shadowInfo.ambientShadowBlur, 0f, 0f, - Color.alpha(shadowInfo.ambientShadowColor).toFloat() + Color.alpha(shadowInfo.ambientShadowColor).toFloat(), ) verify(shadowDrawableUnderTest) .createShadowRenderEffect( shadowInfo.keyShadowBlur, shadowInfo.keyShadowOffsetX, shadowInfo.keyShadowOffsetY, - Color.alpha(shadowInfo.keyShadowColor).toFloat() + Color.alpha(shadowInfo.keyShadowColor).toFloat(), ) } } diff --git a/tests/src/com/android/launcher3/model/LoaderTaskTest.kt b/tests/src/com/android/launcher3/model/LoaderTaskTest.kt index f8516cc04b..4bed473750 100644 --- a/tests/src/com/android/launcher3/model/LoaderTaskTest.kt +++ b/tests/src/com/android/launcher3/model/LoaderTaskTest.kt @@ -39,7 +39,6 @@ import com.android.launcher3.model.data.IconRequestInfo import com.android.launcher3.model.data.WorkspaceItemInfo import com.android.launcher3.pm.UserCache import com.android.launcher3.provider.RestoreDbTask -import com.android.launcher3.ui.TestViewHelpers import com.android.launcher3.util.AllModulesForTest import com.android.launcher3.util.Executors.MODEL_EXECUTOR import com.android.launcher3.util.LooperIdleLock @@ -47,6 +46,7 @@ import com.android.launcher3.util.ModelTestExtensions import com.android.launcher3.util.SandboxApplication import com.android.launcher3.util.TestUtil import com.android.launcher3.util.UserIconInfo +import com.android.launcher3.util.ui.TestViewHelpers import com.google.common.truth.Truth.assertThat import dagger.BindsInstance import dagger.Component diff --git a/tests/src/com/android/launcher3/ui/ShadowInfoTest.kt b/tests/src/com/android/launcher3/model/ShadowInfoTest.kt similarity index 97% rename from tests/src/com/android/launcher3/ui/ShadowInfoTest.kt rename to tests/src/com/android/launcher3/model/ShadowInfoTest.kt index ef4dc1a8e7..faa0427295 100644 --- a/tests/src/com/android/launcher3/ui/ShadowInfoTest.kt +++ b/tests/src/com/android/launcher3/model/ShadowInfoTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.launcher3.ui +package com.android.launcher3.model import android.content.Context import android.content.res.TypedArray @@ -47,7 +47,7 @@ class ShadowInfoTest { keyShadowBlur = 3f, keyShadowOffsetX = 4f, keyShadowOffsetY = 5f, - keyShadowColor = 6 + keyShadowColor = 6, ) doReturn(styledAttrs) .whenever(mockContext) diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java index 46a79526ff..699224e887 100644 --- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java +++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 The Android Open Source Project + * Copyright (C) 2025 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. @@ -24,10 +24,12 @@ import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import com.android.launcher3.Launcher; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; import org.junit.Test; import org.junit.runner.RunWith; +// TODO(415813575) - Remove this test. @LargeTest @RunWith(AndroidJUnit4.class) public class TaplTestsLauncher3Test extends AbstractLauncherUiTest { diff --git a/tests/src/com/android/launcher3/util/ItemInflaterTest.kt b/tests/src/com/android/launcher3/util/ItemInflaterTest.kt index a1dfc538dc..4f01a21573 100644 --- a/tests/src/com/android/launcher3/util/ItemInflaterTest.kt +++ b/tests/src/com/android/launcher3/util/ItemInflaterTest.kt @@ -42,10 +42,10 @@ import com.android.launcher3.model.data.LauncherAppWidgetInfo import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_ID_NOT_VALID import com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_UI_NOT_READY import com.android.launcher3.model.data.LauncherAppWidgetInfo.RESTORE_COMPLETED -import com.android.launcher3.ui.TestViewHelpers import com.android.launcher3.util.Executors.MAIN_EXECUTOR import com.android.launcher3.util.Executors.VIEW_PREINFLATION_EXECUTOR import com.android.launcher3.util.rule.ShellCommandRule +import com.android.launcher3.util.ui.TestViewHelpers import com.android.launcher3.widget.LauncherAppWidgetHostView import com.android.launcher3.widget.LauncherWidgetHolder import com.android.launcher3.widget.PendingAppWidgetHostView diff --git a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java index 3b8530984c..32d8a0def5 100644 --- a/tests/src/com/android/launcher3/util/rule/FailureWatcher.java +++ b/tests/src/com/android/launcher3/util/rule/FailureWatcher.java @@ -12,7 +12,7 @@ import androidx.test.uiautomator.UiDevice; import com.android.app.viewcapture.data.ExportedData; import com.android.launcher3.tapl.LauncherInstrumentation; -import com.android.launcher3.ui.BaseLauncherTaplTest; +import com.android.launcher3.util.ui.BaseLauncherTaplTest; import org.junit.rules.TestWatcher; import org.junit.runner.Description; diff --git a/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java b/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java index 2b45902813..9b8ee29caf 100644 --- a/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java +++ b/tests/src/com/android/launcher3/util/rule/TestIsolationRule.java @@ -20,7 +20,7 @@ import androidx.test.InstrumentationRegistry; import androidx.test.uiautomator.UiDevice; import com.android.launcher3.tapl.LauncherInstrumentation; -import com.android.launcher3.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; import org.junit.rules.TestRule; import org.junit.runner.Description; diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java similarity index 99% rename from tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java rename to tests/src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java index 6e46fe583a..7a8d6e788e 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/util/ui/AbstractLauncherUiTest.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.android.launcher3.ui; +package com.android.launcher3.util.ui; import static androidx.test.InstrumentationRegistry.getInstrumentation; diff --git a/tests/src/com/android/launcher3/ui/BaseLauncherTaplTest.java b/tests/src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java similarity index 99% rename from tests/src/com/android/launcher3/ui/BaseLauncherTaplTest.java rename to tests/src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java index 59800ecf6f..b743f575fb 100644 --- a/tests/src/com/android/launcher3/ui/BaseLauncherTaplTest.java +++ b/tests/src/com/android/launcher3/util/ui/BaseLauncherTaplTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.launcher3.ui; +package com.android.launcher3.util.ui; import static android.os.Process.myUserHandle; import static android.platform.test.flag.junit.SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT; @@ -51,7 +51,6 @@ import androidx.test.uiautomator.BySelector; import androidx.test.uiautomator.UiDevice; import androidx.test.uiautomator.Until; -import com.android.launcher3.celllayout.FavoriteItemsTransaction; import com.android.launcher3.tapl.HomeAllApps; import com.android.launcher3.tapl.HomeAppIcon; import com.android.launcher3.tapl.LauncherInstrumentation; @@ -65,6 +64,7 @@ import com.android.launcher3.util.rule.ScreenRecordRule; import com.android.launcher3.util.rule.ShellCommandRule; import com.android.launcher3.util.rule.TestIsolationRule; import com.android.launcher3.util.rule.TestStabilityRule; +import com.android.launcher3.util.workspace.FavoriteItemsTransaction; import org.junit.After; import org.junit.Assert; diff --git a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java b/tests/src/com/android/launcher3/util/ui/PortraitLandscapeRunner.java similarity index 87% rename from tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java rename to tests/src/com/android/launcher3/util/ui/PortraitLandscapeRunner.java index 7784c03431..e5b45b9277 100644 --- a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java +++ b/tests/src/com/android/launcher3/util/ui/PortraitLandscapeRunner.java @@ -1,4 +1,20 @@ -package com.android.launcher3.ui; +/* + * Copyright (C) 2025 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.util.ui; import static com.android.launcher3.LauncherPrefs.FIXED_LANDSCAPE_MODE; diff --git a/tests/src/com/android/launcher3/util/viewcapture_analysis/Android.bp b/tests/src/com/android/launcher3/util/viewcapture_analysis/Android.bp new file mode 100644 index 0000000000..6e749e6d37 --- /dev/null +++ b/tests/src/com/android/launcher3/util/viewcapture_analysis/Android.bp @@ -0,0 +1,10 @@ +filegroup { + name: "launcher-viewcapture-analysis", + srcs: [ + "FlashDetector.java", + "AlphaJumpDetector.java", + "AnomalyDetector.java", + "PositionJumpDetector.java", + "ViewCaptureAnalyzer.java", + ], +} diff --git a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java b/tests/src/com/android/launcher3/widget/AddConfigWidgetTest.java similarity index 94% rename from tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java rename to tests/src/com/android/launcher3/widget/AddConfigWidgetTest.java index f777049f0a..cde9d80381 100644 --- a/tests/src/com/android/launcher3/ui/widget/AddConfigWidgetTest.java +++ b/tests/src/com/android/launcher3/widget/AddConfigWidgetTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.launcher3.ui.widget; +package com.android.launcher3.widget; import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; @@ -34,21 +34,18 @@ import androidx.test.filters.LargeTest; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.Launcher; -import com.android.launcher3.celllayout.FavoriteItemsTransaction; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.testcomponent.WidgetConfigActivity; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; -import com.android.launcher3.ui.TestViewHelpers; import com.android.launcher3.util.BaseLauncherActivityTest; import com.android.launcher3.util.BlockingBroadcastReceiver; import com.android.launcher3.util.PackageUserKey; import com.android.launcher3.util.Wait; import com.android.launcher3.util.rule.ShellCommandRule; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.ui.TestViewHelpers; +import com.android.launcher3.util.workspace.FavoriteItemsTransaction; import com.android.launcher3.views.OptionsPopupView; -import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; -import com.android.launcher3.widget.PendingAddWidgetInfo; -import com.android.launcher3.widget.WidgetCell; import com.android.launcher3.widget.picker.WidgetsFullSheet; import com.android.launcher3.widget.picker.WidgetsListAdapter; import com.android.launcher3.widget.picker.WidgetsRecyclerView; diff --git a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java b/tests/src/com/android/launcher3/widget/BindWidgetTest.java similarity index 96% rename from tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java rename to tests/src/com/android/launcher3/widget/BindWidgetTest.java index d17f5a95dd..1bfd5a9a34 100644 --- a/tests/src/com/android/launcher3/ui/widget/BindWidgetTest.java +++ b/tests/src/com/android/launcher3/widget/BindWidgetTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.launcher3.ui.widget; +package com.android.launcher3.widget; import static com.android.launcher3.WorkspaceLayoutManager.FIRST_SCREEN_ID; import static com.android.launcher3.model.data.LauncherAppWidgetInfo.FLAG_ID_NOT_VALID; @@ -46,16 +46,12 @@ import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherSettings; import com.android.launcher3.R; -import com.android.launcher3.celllayout.FavoriteItemsTransaction; import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.pm.InstallSessionHelper; -import com.android.launcher3.ui.TestViewHelpers; import com.android.launcher3.util.BaseLauncherActivityTest; import com.android.launcher3.util.rule.ShellCommandRule; -import com.android.launcher3.widget.LauncherAppWidgetHostView; -import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; -import com.android.launcher3.widget.PendingAppWidgetHostView; -import com.android.launcher3.widget.WidgetManagerHelper; +import com.android.launcher3.util.ui.TestViewHelpers; +import com.android.launcher3.util.workspace.FavoriteItemsTransaction; import org.junit.After; import org.junit.Before; diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/widget/RequestPinItemTest.java similarity index 98% rename from tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java rename to tests/src/com/android/launcher3/widget/RequestPinItemTest.java index 91ad341440..393dc56f63 100644 --- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java +++ b/tests/src/com/android/launcher3/widget/RequestPinItemTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.launcher3.ui.widget; +package com.android.launcher3.widget; import static android.app.PendingIntent.FLAG_MUTABLE; import static android.app.PendingIntent.FLAG_ONE_SHOT; @@ -39,7 +39,6 @@ import androidx.test.uiautomator.BySelector; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherSettings.Favorites; -import com.android.launcher3.celllayout.FavoriteItemsTransaction; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.model.data.LauncherAppWidgetInfo; import com.android.launcher3.model.data.WorkspaceItemInfo; @@ -53,6 +52,7 @@ import com.android.launcher3.util.LauncherBindableItemsContainer.ItemOperator; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.rule.ScreenRecordRule; import com.android.launcher3.util.rule.ShellCommandRule; +import com.android.launcher3.util.workspace.FavoriteItemsTransaction; import org.junit.Before; import org.junit.Rule; diff --git a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java b/tests/src/com/android/launcher3/widget/TaplAddWidgetTest.java similarity index 92% rename from tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java rename to tests/src/com/android/launcher3/widget/TaplAddWidgetTest.java index fda4f7cb55..b18b6497e3 100644 --- a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java +++ b/tests/src/com/android/launcher3/widget/TaplAddWidgetTest.java @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ -package com.android.launcher3.ui.widget; +package com.android.launcher3.widget; import static org.junit.Assert.assertNotNull; @@ -24,15 +24,14 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.LargeTest; import com.android.launcher3.Launcher; -import com.android.launcher3.celllayout.FavoriteItemsTransaction; import com.android.launcher3.tapl.Widget; import com.android.launcher3.tapl.WidgetResizeFrame; -import com.android.launcher3.ui.AbstractLauncherUiTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; -import com.android.launcher3.ui.TestViewHelpers; import com.android.launcher3.util.TestUtil; import com.android.launcher3.util.rule.ShellCommandRule; -import com.android.launcher3.widget.LauncherAppWidgetProviderInfo; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; +import com.android.launcher3.util.ui.TestViewHelpers; +import com.android.launcher3.util.workspace.FavoriteItemsTransaction; import org.junit.Assume; import org.junit.Rule; diff --git a/tests/src/com/android/launcher3/ui/widget/WidgetPickerTest.java b/tests/src/com/android/launcher3/widget/picker/WidgetPickerTest.java similarity index 93% rename from tests/src/com/android/launcher3/ui/widget/WidgetPickerTest.java rename to tests/src/com/android/launcher3/widget/picker/WidgetPickerTest.java index 7d9843a22f..9adc95c7bc 100644 --- a/tests/src/com/android/launcher3/ui/widget/WidgetPickerTest.java +++ b/tests/src/com/android/launcher3/widget/picker/WidgetPickerTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.launcher3.ui.widget; +package com.android.launcher3.widget.picker; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -24,13 +24,11 @@ import androidx.test.filters.MediumTest; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.Launcher; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.BaseLauncherActivityTest; import com.android.launcher3.util.rule.ScreenRecordRule; import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.views.OptionsPopupView; -import com.android.launcher3.widget.picker.WidgetsFullSheet; -import com.android.launcher3.widget.picker.WidgetsRecyclerView; import org.junit.Rule; import org.junit.Test; diff --git a/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java b/tests/src/com/android/launcher3/workspace/TaplTwoPanelWorkspaceTest.java similarity index 98% rename from tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java rename to tests/src/com/android/launcher3/workspace/TaplTwoPanelWorkspaceTest.java index 7081768b70..bac2e41007 100644 --- a/tests/src/com/android/launcher3/ui/workspace/TaplTwoPanelWorkspaceTest.java +++ b/tests/src/com/android/launcher3/workspace/TaplTwoPanelWorkspaceTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.android.launcher3.ui.workspace; +package com.android.launcher3.workspace; import static com.android.launcher3.util.TestConstants.AppNames.CHROME_APP_NAME; import static com.android.launcher3.util.TestConstants.AppNames.MAPS_APP_NAME; @@ -35,10 +35,10 @@ import com.android.launcher3.CellLayout; import com.android.launcher3.Launcher; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.tapl.Workspace; -import com.android.launcher3.ui.AbstractLauncherUiTest; -import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape; import com.android.launcher3.util.LauncherLayoutBuilder; import com.android.launcher3.util.TestUtil; +import com.android.launcher3.util.ui.AbstractLauncherUiTest; +import com.android.launcher3.util.ui.PortraitLandscapeRunner.PortraitLandscape; import org.junit.After; import org.junit.Before; @@ -372,4 +372,4 @@ public class TaplTwoPanelWorkspaceTest extends AbstractLauncherUiTest