diff options
| author | 2023-09-06 22:50:24 +0000 | |
|---|---|---|
| committer | 2023-09-06 23:02:46 +0000 | |
| commit | 39e0d0b3e4b78abf1cf5c83c74789d9410cbc621 (patch) | |
| tree | b8ac22f6c44aef8a89572df3f3199f8b88e7fd9f | |
| parent | 57ed0558495273ea576e5f9db637d16cc167ea9a (diff) | |
Migrate /systemui/smartspace tests to bivalent.
Bivalent: runs both without a device and with a device.
Currently these tests require a device to run.
Updated these tests to bivalent, and added them to SystemUiRoboTests,
which run deviceless. Without the SystemUiRoboTests: prefix, the tests
run on a device.
Fix: 297941881
Test: atest SystemUiRoboTests:BcSmartspaceConfigProviderTest SystemUiRoboTests:DreamSmartspaceControllerTest SystemUiRoboTests:LockscreenAndDreamTargetFilterTest SystemUiRoboTests:LockscreenPreconditionTest
Test: atest BcSmartspaceConfigProviderTest DreamSmartspaceControllerTest LockscreenAndDreamTargetFilterTest LockscreenPreconditionTest
Change-Id: I59a5274561cbb1693ebf948cbc73fa47871bb847
5 files changed, 22 insertions, 8 deletions
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp index 089ddbeda53b..7bbb46638c99 100644 --- a/packages/SystemUI/Android.bp +++ b/packages/SystemUI/Android.bp @@ -348,6 +348,12 @@ filegroup { "tests/src/com/android/systemui/dreams/DreamOverlayStateControllerTest.java", "tests/src/com/android/systemui/dreams/DreamOverlayStatusBarItemsProviderTest.java", "tests/src/com/android/systemui/dreams/DreamOverlayStatusBarViewControllerTest.java", + + /* Smartspace tests */ + "tests/src/com/android/systemui/smartspace/BcSmartspaceConfigProviderTest.kt", + "tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt", + "tests/src/com/android/systemui/smartspace/LockscreenAndDreamTargetFilterTest.kt", + "tests/src/com/android/systemui/smartspace/LockscreenPreconditionTest.kt", ], path: "tests/src", } diff --git a/packages/SystemUI/tests/src/com/android/systemui/smartspace/BcSmartspaceConfigProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/smartspace/BcSmartspaceConfigProviderTest.kt index 5fb1e79e93e8..7a2d12269885 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/smartspace/BcSmartspaceConfigProviderTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/smartspace/BcSmartspaceConfigProviderTest.kt @@ -16,8 +16,9 @@ package com.android.systemui.smartspace -import android.testing.AndroidTestingRunner +import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest +import com.android.systemui.RoboPilotTest import com.android.systemui.SysuiTestCase import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags @@ -32,7 +33,8 @@ import org.mockito.Mock import org.mockito.MockitoAnnotations @SmallTest -@RunWith(AndroidTestingRunner::class) +@RoboPilotTest +@RunWith(AndroidJUnit4::class) class BcSmartspaceConfigProviderTest : SysuiTestCase() { @Mock private lateinit var featureFlags: FeatureFlags diff --git a/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt index 19dc72d6c2e3..f1c181fb2235 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/smartspace/DreamSmartspaceControllerTest.kt @@ -20,12 +20,13 @@ import android.app.smartspace.SmartspaceSession import android.app.smartspace.SmartspaceTarget import android.content.Context import android.graphics.drawable.Drawable -import android.testing.AndroidTestingRunner import android.testing.TestableLooper import android.view.View import android.view.ViewGroup import android.widget.FrameLayout +import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest +import com.android.systemui.RoboPilotTest import com.android.systemui.SysuiTestCase import com.android.systemui.dreams.smartspace.DreamSmartspaceController import com.android.systemui.plugins.BcSmartspaceConfigPlugin @@ -52,7 +53,8 @@ import org.mockito.MockitoAnnotations import org.mockito.Spy @SmallTest -@RunWith(AndroidTestingRunner::class) +@RoboPilotTest +@RunWith(AndroidJUnit4::class) @TestableLooper.RunWithLooper class DreamSmartspaceControllerTest : SysuiTestCase() { @Mock diff --git a/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenAndDreamTargetFilterTest.kt b/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenAndDreamTargetFilterTest.kt index 6b34ca7284eb..7af29ba28df1 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenAndDreamTargetFilterTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenAndDreamTargetFilterTest.kt @@ -22,9 +22,10 @@ import android.net.Uri import android.os.Handler import android.os.UserHandle import android.provider.Settings -import android.testing.AndroidTestingRunner import android.testing.TestableLooper +import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest +import com.android.systemui.RoboPilotTest import com.android.systemui.SysuiTestCase import com.android.systemui.settings.UserTracker import com.android.systemui.smartspace.filters.LockscreenAndDreamTargetFilter @@ -51,7 +52,8 @@ import org.mockito.MockitoAnnotations @SmallTest @TestableLooper.RunWithLooper -@RunWith(AndroidTestingRunner::class) +@RoboPilotTest +@RunWith(AndroidJUnit4::class) class LockscreenAndDreamTargetFilterTest : SysuiTestCase() { @Mock private lateinit var secureSettings: SecureSettings diff --git a/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenPreconditionTest.kt b/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenPreconditionTest.kt index fa7d869b6b95..a7c223dc4b8a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenPreconditionTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/smartspace/LockscreenPreconditionTest.kt @@ -16,9 +16,10 @@ package com.android.systemui.smartspace -import android.testing.AndroidTestingRunner import android.testing.TestableLooper +import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest +import com.android.systemui.RoboPilotTest import com.android.systemui.SysuiTestCase import com.android.systemui.smartspace.preconditions.LockscreenPrecondition import com.android.systemui.statusbar.policy.DeviceProvisionedController @@ -35,7 +36,8 @@ import org.mockito.Mockito.verify import org.mockito.MockitoAnnotations @SmallTest -@RunWith(AndroidTestingRunner::class) +@RoboPilotTest +@RunWith(AndroidJUnit4::class) @TestableLooper.RunWithLooper class LockscreenPreconditionTest : SysuiTestCase() { @Mock |