From 3b2a1362726737772b3ac321f8f03f301715983e Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Wed, 29 May 2024 18:10:27 +0000 Subject: [PATCH] Run UiThreadTest in LauncherMultivalentJUnit Additionally migrating DisplayControllerTest to multivalent Flag: TEST_ONLY Test: atest NexusLauncherRoboTests Test: SysUI studio Change-Id: I9ff89218947b32f79b39bb0e6dd4beabec3b7369 --- .../src/com/android/launcher3/util/DisplayControllerTest.kt | 3 +-- tests/src/com/android/launcher3/popup/SystemShortcutTest.java | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) rename tests/{ => multivalentTests}/src/com/android/launcher3/util/DisplayControllerTest.kt (98%) diff --git a/tests/src/com/android/launcher3/util/DisplayControllerTest.kt b/tests/multivalentTests/src/com/android/launcher3/util/DisplayControllerTest.kt similarity index 98% rename from tests/src/com/android/launcher3/util/DisplayControllerTest.kt rename to tests/multivalentTests/src/com/android/launcher3/util/DisplayControllerTest.kt index 273f0c4491..41effa2f01 100644 --- a/tests/src/com/android/launcher3/util/DisplayControllerTest.kt +++ b/tests/multivalentTests/src/com/android/launcher3/util/DisplayControllerTest.kt @@ -27,7 +27,6 @@ import android.view.Display import android.view.Surface import androidx.test.annotation.UiThreadTest import androidx.test.core.app.ApplicationProvider -import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.launcher3.LauncherPrefs import com.android.launcher3.LauncherPrefs.Companion.TASKBAR_PINNING @@ -55,7 +54,7 @@ import org.mockito.stubbing.Answer /** Unit tests for {@link DisplayController} */ @SmallTest -@RunWith(AndroidJUnit4::class) +@RunWith(LauncherMultivalentJUnit::class) class DisplayControllerTest { private val appContext: Context = ApplicationProvider.getApplicationContext() diff --git a/tests/src/com/android/launcher3/popup/SystemShortcutTest.java b/tests/src/com/android/launcher3/popup/SystemShortcutTest.java index c663be0fb5..98b6b4b7a8 100644 --- a/tests/src/com/android/launcher3/popup/SystemShortcutTest.java +++ b/tests/src/com/android/launcher3/popup/SystemShortcutTest.java @@ -49,7 +49,6 @@ import android.platform.test.flag.junit.SetFlagsRule; import android.view.View; import androidx.test.annotation.UiThreadTest; -import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.filters.SmallTest; import com.android.launcher3.allapps.PrivateProfileManager; @@ -60,6 +59,7 @@ import com.android.launcher3.pm.UserCache; import com.android.launcher3.util.ApiWrapper; import com.android.launcher3.util.ComponentKey; import com.android.launcher3.util.LauncherModelHelper.SandboxModelContext; +import com.android.launcher3.util.LauncherMultivalentJUnit; import com.android.launcher3.util.TestSandboxModelContextWrapper; import com.android.launcher3.util.UserIconInfo; import com.android.launcher3.views.BaseDragLayer; @@ -76,7 +76,7 @@ import org.mockito.MockitoAnnotations; import java.util.ArrayList; @SmallTest -@RunWith(AndroidJUnit4.class) +@RunWith(LauncherMultivalentJUnit.class) public class SystemShortcutTest { @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(DEVICE_DEFAULT); private static final UserHandle PRIVATE_HANDLE = new UserHandle(11);