Remove the initialize method from setUp since is now on being called on the super method.
Bug: 324261526
Test: most Tapl test
Flag: NA
Change-Id: Icbf9883613069101a3c8428e8e3b02b1eb01dcd0
diff --git a/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java b/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
index 7c1b7f3..3f3b9ed 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplOverviewIconTest.java
@@ -29,7 +29,6 @@
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.util.rule.TestStabilityRule;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -41,12 +40,6 @@
private static final String CALCULATOR_APP_PACKAGE =
resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR);
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
@PlatinumTest(focusArea = "launcher")
@Test
public void testOverviewActionsMenu() {
diff --git a/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java b/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java
index 7e274e8..b31f470 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplStartLauncherViaGestureTests.java
@@ -22,7 +22,6 @@
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.util.rule.TestStabilityRule.Stability;
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
@@ -40,7 +39,6 @@
@Before
public void setUp() throws Exception {
super.setUp();
- AbstractLauncherUiTest.initialize(this);
// b/143488140
mLauncher.goHome();
// Start an activity where the gestures start.
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsKeyboardQuickSwitch.java b/quickstep/tests/src/com/android/quickstep/TaplTestsKeyboardQuickSwitch.java
index a050464..25d9f62 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsKeyboardQuickSwitch.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsKeyboardQuickSwitch.java
@@ -25,7 +25,6 @@
import com.android.launcher3.tapl.LaunchedAppState;
import com.android.launcher3.tapl.Taskbar;
import com.android.launcher3.taskbar.KeyboardQuickSwitchController;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
import org.junit.Assume;
import org.junit.Test;
@@ -69,7 +68,6 @@
public void setUp() throws Exception {
Assume.assumeTrue(mLauncher.isTablet());
super.setUp();
- AbstractLauncherUiTest.initialize(this);
startAppFast(CALCULATOR_APP_PACKAGE);
startTestActivity(2);
}
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
index 360d1a7..38e0a5e 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsQuickstep.java
@@ -44,7 +44,6 @@
import com.android.launcher3.tapl.OverviewActions;
import com.android.launcher3.tapl.OverviewTask;
import com.android.launcher3.tapl.SelectModeButtons;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
@@ -70,7 +69,6 @@
@Before
public void setUp() throws Exception {
super.setUp();
- AbstractLauncherUiTest.initialize(this);
executeOnLauncher(launcher -> {
RecentsView recentsView = launcher.getOverviewPanel();
recentsView.getPagedViewOrientedState().forceAllowRotationForTesting(true);
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
index b7546c7..ec8e00d 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsSplitscreen.java
@@ -33,7 +33,6 @@
import com.android.launcher3.tapl.Overview;
import com.android.launcher3.tapl.Taskbar;
import com.android.launcher3.tapl.TaskbarAppIcon;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.launcher3.util.rule.TestStabilityRule;
import com.android.quickstep.TaskbarModeSwitchRule.TaskbarModeSwitch;
@@ -41,7 +40,6 @@
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -59,7 +57,6 @@
@Before
public void setUp() throws Exception {
super.setUp();
- AbstractLauncherUiTest.initialize(this);
if (mLauncher.isTablet()) {
mLauncher.enableBlockTimeout(true);
diff --git a/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java b/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java
index b0e91e4..aa8c7b5 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplTestsTrackpad.java
@@ -31,12 +31,10 @@
import com.android.launcher3.Flags;
import com.android.launcher3.tapl.LauncherInstrumentation.TrackpadGestureType;
import com.android.launcher3.tapl.Workspace;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
import com.android.quickstep.NavigationModeSwitchRule.NavigationModeSwitch;
import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -47,12 +45,6 @@
private static final String READ_DEVICE_CONFIG_PERMISSION =
"android.permission.READ_DEVICE_CONFIG";
- @Before
- public void setUp() throws Exception {
- super.setUp();
- AbstractLauncherUiTest.initialize(this);
- }
-
@After
public void tearDown() {
mLauncher.setTrackpadGestureType(TrackpadGestureType.NONE);
diff --git a/quickstep/tests/src/com/android/quickstep/TaplViewInflationDuringSwipeUp.java b/quickstep/tests/src/com/android/quickstep/TaplViewInflationDuringSwipeUp.java
index f76e17a..6093816 100644
--- a/quickstep/tests/src/com/android/quickstep/TaplViewInflationDuringSwipeUp.java
+++ b/quickstep/tests/src/com/android/quickstep/TaplViewInflationDuringSwipeUp.java
@@ -56,7 +56,6 @@
import com.android.launcher3.testcomponent.ListViewService;
import com.android.launcher3.testcomponent.ListViewService.SimpleViewsFactory;
import com.android.launcher3.testcomponent.TestCommandReceiver;
-import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.TestViewHelpers;
import com.android.launcher3.util.Executors;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
@@ -93,8 +92,6 @@
@Before
public void setUp() throws Exception {
- super.setUp();
-
// Workaround for b/142351228, when there are no activities, the system may not destroy the
// activity correctly for activities under instrumentation, which can leave two concurrent
// activities, which changes the order in which the activities are cleaned up (overlapping
@@ -102,7 +99,7 @@
// is started only after starting another app.
startAppFast(resolveSystemApp(Intent.CATEGORY_APP_CALCULATOR));
- AbstractLauncherUiTest.initialize(this);
+ super.setUp();
mModel = LauncherAppState.getInstance(mTargetContext).getModel();
Executors.MODEL_EXECUTOR.submit(mModel.getModelDbController()::createEmptyDB).get();
diff --git a/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java b/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java
index ef5af0f..10e9f8a 100644
--- a/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java
+++ b/tests/src/com/android/launcher3/allapps/TaplAllAppsIconsWorkingTest.java
@@ -24,7 +24,6 @@
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -33,12 +32,6 @@
*/
public class TaplAllAppsIconsWorkingTest extends AbstractLauncherUiTest {
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
/**
* Makes sure we can launch an icon from All apps
*/
diff --git a/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java b/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java
index db574a1..0360470 100644
--- a/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java
+++ b/tests/src/com/android/launcher3/allapps/TaplKeyboardFocusTest.java
@@ -32,7 +32,6 @@
import com.android.launcher3.util.rule.TestStabilityRule;
import com.android.launcher3.views.ActivityContext;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -40,12 +39,6 @@
@RunWith(AndroidJUnit4.class)
public class TaplKeyboardFocusTest extends AbstractLauncherUiTest {
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
@Test
public void testAllAppsFocusApp() {
final HomeAllApps allApps = mLauncher.goHome().switchToAllApps();
diff --git a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
index 6fce4c6..1942f28 100644
--- a/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
+++ b/tests/src/com/android/launcher3/allapps/TaplOpenCloseAllAppsTest.java
@@ -35,7 +35,6 @@
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -48,15 +47,6 @@
"android.permission.READ_DEVICE_CONFIG";
/**
- * Calls static method initialize
- */
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
- /**
* Make sure we can go home after pressing the context menu on an Icon on the AllApps.
*/
@Test
diff --git a/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java b/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java
index ec24397..c69d1b9 100644
--- a/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java
+++ b/tests/src/com/android/launcher3/appiconmenu/TaplAppIconMenuTest.java
@@ -31,7 +31,6 @@
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.PortraitLandscapeRunner.PortraitLandscape;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -41,12 +40,6 @@
*/
public class TaplAppIconMenuTest extends AbstractLauncherUiTest {
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
private boolean isOptionsPopupVisible(Launcher launcher) {
final ArrowPopup<?> popup = launcher.getOptionsPopup();
return popup != null && popup.isShown();
diff --git a/tests/src/com/android/launcher3/celllayout/TaplReorderWidgetsTest.java b/tests/src/com/android/launcher3/celllayout/TaplReorderWidgetsTest.java
index 8bdcd03..aca9765 100644
--- a/tests/src/com/android/launcher3/celllayout/TaplReorderWidgetsTest.java
+++ b/tests/src/com/android/launcher3/celllayout/TaplReorderWidgetsTest.java
@@ -72,7 +72,7 @@
@Before
public void setup() throws Throwable {
mWorkspaceBuilder = new TestWorkspaceBuilder(mTargetContext);
- AbstractLauncherUiTest.initialize(this);
+ super.setUp();
}
@After
diff --git a/tests/src/com/android/launcher3/dragging/TaplDragTest.java b/tests/src/com/android/launcher3/dragging/TaplDragTest.java
index 9942602..d57461f 100644
--- a/tests/src/com/android/launcher3/dragging/TaplDragTest.java
+++ b/tests/src/com/android/launcher3/dragging/TaplDragTest.java
@@ -16,8 +16,8 @@
package com.android.launcher3.dragging;
import static com.android.launcher3.util.TestConstants.AppNames.GMAIL_APP_NAME;
-import static com.android.launcher3.util.TestConstants.AppNames.PHOTOS_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.MAPS_APP_NAME;
+import static com.android.launcher3.util.TestConstants.AppNames.PHOTOS_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.STORE_APP_NAME;
import static com.android.launcher3.util.TestConstants.AppNames.TEST_APP_NAME;
import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
@@ -44,7 +44,6 @@
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
import com.android.launcher3.util.rule.TestStabilityRule;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -59,12 +58,6 @@
*/
public class TaplDragTest extends AbstractLauncherUiTest {
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
/**
* Adds two icons to the Workspace and combines them into a folder, then makes sure the icons
* are no longer in the Workspace then adds a third one to test adding an icon to an existing
diff --git a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
index 1e765c0..23af791 100644
--- a/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
+++ b/tests/src/com/android/launcher3/dragging/TaplUninstallRemoveTest.java
@@ -39,7 +39,6 @@
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.TestStabilityRule;
-import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
@@ -52,12 +51,6 @@
*/
public class TaplUninstallRemoveTest extends AbstractLauncherUiTest {
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
/**
* Deletes app both built-in and user-installed from the Workspace and makes sure it's no longer
* in the Workspace.
diff --git a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
index d26a9db..4eae7e1 100644
--- a/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
+++ b/tests/src/com/android/launcher3/ui/TaplTestsLauncher3Test.java
@@ -21,7 +21,6 @@
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -29,12 +28,6 @@
@RunWith(AndroidJUnit4.class)
public class TaplTestsLauncher3Test extends AbstractLauncherUiTest {
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
@Test
public void testDevicePressMenu() throws Exception {
mDevice.pressMenu();
diff --git a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java b/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
index ec226af..5ca5ba5 100644
--- a/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/TaplAddWidgetTest.java
@@ -37,7 +37,6 @@
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import org.junit.Assume;
-import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -52,13 +51,6 @@
@Rule
public ShellCommandRule mGrantWidgetRule = ShellCommandRule.grantWidgetBind();
- @Override
- @Before
- public void setUp() throws Exception {
- super.setUp();
- AbstractLauncherUiTest.initialize(this);
- }
-
@Test
@PortraitLandscape
@ScreenRecord // b/316910614
diff --git a/tests/src/com/android/launcher3/ui/widget/TaplRequestPinItemTest.java b/tests/src/com/android/launcher3/ui/widget/TaplRequestPinItemTest.java
index f12f961..7dba728 100644
--- a/tests/src/com/android/launcher3/ui/widget/TaplRequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/TaplRequestPinItemTest.java
@@ -74,7 +74,6 @@
super.setUp();
mCallbackAction = UUID.randomUUID().toString();
mShortcutId = UUID.randomUUID().toString();
- AbstractLauncherUiTest.initialize(this);
}
@Test
diff --git a/tests/src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java b/tests/src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java
index bc73683..1cd8c88 100644
--- a/tests/src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/TaplWidgetPickerTest.java
@@ -30,7 +30,6 @@
import com.android.launcher3.widget.picker.WidgetsFullSheet;
import com.android.launcher3.widget.picker.WidgetsRecyclerView;
-import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,12 +41,6 @@
@RunWith(AndroidJUnit4.class)
public class TaplWidgetPickerTest extends AbstractLauncherUiTest {
- @Before
- public void setUp() throws Exception {
- super.setUp();
- initialize(this);
- }
-
private WidgetsRecyclerView getWidgetsView(Launcher launcher) {
return WidgetsFullSheet.getWidgetsView(launcher);
}
diff --git a/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java b/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java
index a3d3344..c60ee8c 100644
--- a/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java
+++ b/tests/src/com/android/launcher3/ui/workspace/TaplThemeIconsTest.java
@@ -57,7 +57,7 @@
@Test
public void testIconWithoutTheme() throws Exception {
setThemeEnabled(false);
- AbstractLauncherUiTest.initialize(this);
+ initialize(this);
HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
@@ -75,7 +75,7 @@
@Test
public void testShortcutIconWithoutTheme() throws Exception {
setThemeEnabled(false);
- AbstractLauncherUiTest.initialize(this);
+ initialize(this);
HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
@@ -94,7 +94,7 @@
@Test
public void testIconWithTheme() throws Exception {
setThemeEnabled(true);
- AbstractLauncherUiTest.initialize(this);
+ initialize(this);
HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();
@@ -112,7 +112,7 @@
@Test
public void testShortcutIconWithTheme() throws Exception {
setThemeEnabled(true);
- AbstractLauncherUiTest.initialize(this);
+ initialize(this);
HomeAllApps allApps = mLauncher.getWorkspace().switchToAllApps();
allApps.freeze();