diff options
94 files changed, 279 insertions, 316 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardUnfoldTransitionTest.kt b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardUnfoldTransitionTest.kt index 245388c214a5..b0db8b70d296 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardUnfoldTransitionTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardUnfoldTransitionTest.kt @@ -22,12 +22,12 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.customization.R as customR import com.android.systemui.keyguard.ui.view.KeyguardRootView -import com.android.systemui.kosmos.Kosmos import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.res.R import com.android.systemui.shade.NotificationShadeWindowView import com.android.systemui.statusbar.StatusBarState.KEYGUARD import com.android.systemui.statusbar.StatusBarState.SHADE +import com.android.systemui.testKosmos import com.android.systemui.unfold.FakeUnfoldTransitionProvider import com.android.systemui.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener import com.android.systemui.unfold.fakeUnfoldTransitionProgressProvider @@ -47,16 +47,14 @@ import org.mockito.kotlin.whenever @RunWith(AndroidJUnit4::class) class KeyguardUnfoldTransitionTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val progressProvider: FakeUnfoldTransitionProvider = kosmos.fakeUnfoldTransitionProgressProvider - @Mock - private lateinit var keyguardRootView: KeyguardRootView + @Mock private lateinit var keyguardRootView: KeyguardRootView - @Mock - private lateinit var notificationShadeWindowView: NotificationShadeWindowView + @Mock private lateinit var notificationShadeWindowView: NotificationShadeWindowView @Mock private lateinit var statusBarStateController: StatusBarStateController @@ -71,10 +69,14 @@ class KeyguardUnfoldTransitionTest : SysuiTestCase() { xTranslationMax = context.resources.getDimensionPixelSize(R.dimen.keyguard_unfold_translation_x).toFloat() - underTest = KeyguardUnfoldTransition( - context, keyguardRootView, notificationShadeWindowView, - statusBarStateController, progressProvider - ) + underTest = + KeyguardUnfoldTransition( + context, + keyguardRootView, + notificationShadeWindowView, + statusBarStateController, + progressProvider, + ) underTest.setup() underTest.statusViewCentered = false @@ -88,9 +90,8 @@ class KeyguardUnfoldTransitionTest : SysuiTestCase() { underTest.statusViewCentered = true val view = View(context) - whenever(keyguardRootView.findViewById<View>(customR.id.lockscreen_clock_view_large)).thenReturn( - view - ) + whenever(keyguardRootView.findViewById<View>(customR.id.lockscreen_clock_view_large)) + .thenReturn(view) progressListener.onTransitionStarted() assertThat(view.translationX).isZero() @@ -110,9 +111,8 @@ class KeyguardUnfoldTransitionTest : SysuiTestCase() { whenever(statusBarStateController.getState()).thenReturn(SHADE) val view = View(context) - whenever(keyguardRootView.findViewById<View>(customR.id.lockscreen_clock_view_large)).thenReturn( - view - ) + whenever(keyguardRootView.findViewById<View>(customR.id.lockscreen_clock_view_large)) + .thenReturn(view) progressListener.onTransitionStarted() assertThat(view.translationX).isZero() @@ -133,9 +133,11 @@ class KeyguardUnfoldTransitionTest : SysuiTestCase() { val view = View(context) whenever( - notificationShadeWindowView - .findViewById<View>(customR.id.lockscreen_clock_view_large) - ).thenReturn(view) + notificationShadeWindowView.findViewById<View>( + customR.id.lockscreen_clock_view_large + ) + ) + .thenReturn(view) progressListener.onTransitionStarted() assertThat(view.translationX).isZero() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogDelegateTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogDelegateTest.kt index cde42bd00ba5..76606230a124 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogDelegateTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/extradim/ExtraDimDialogDelegateTest.kt @@ -23,7 +23,6 @@ import androidx.test.filters.SmallTest import com.android.internal.accessibility.AccessibilityShortcutController import com.android.internal.accessibility.common.ShortcutConstants import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope @@ -31,6 +30,7 @@ import com.android.systemui.model.SysUiState import com.android.systemui.res.R import com.android.systemui.settings.UserTracker import com.android.systemui.statusbar.phone.SystemUIDialog +import com.android.systemui.testKosmos import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest @@ -58,7 +58,7 @@ class ExtraDimDialogDelegateTest : SysuiTestCase() { private lateinit var extraDimDialogDelegate: ExtraDimDialogDelegate - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val testScope = kosmos.testScope @Mock private lateinit var dialog: SystemUIDialog @@ -79,7 +79,7 @@ class ExtraDimDialogDelegateTest : SysuiTestCase() { kosmos.testDispatcher, dialogFactory, accessibilityManager, - userTracker + userTracker, ) } @@ -94,7 +94,7 @@ class ExtraDimDialogDelegateTest : SysuiTestCase() { verify(dialog) .setPositiveButton( eq(R.string.accessibility_deprecate_extra_dim_dialog_button), - clickListener.capture() + clickListener.capture(), ) clickListener.firstValue.onClick(dialog, 0) @@ -110,7 +110,7 @@ class ExtraDimDialogDelegateTest : SysuiTestCase() { .flattenToString() ) ), - anyInt() + anyInt(), ) } } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/back/domain/interactor/BackActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/back/domain/interactor/BackActionInteractorTest.kt index 8c5fad3906ed..85733124aedb 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/back/domain/interactor/BackActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/back/domain/interactor/BackActionInteractorTest.kt @@ -32,7 +32,6 @@ import com.android.internal.statusbar.IStatusBarService import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAsleepForTest @@ -50,6 +49,7 @@ import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.notification.domain.interactor.activeNotificationsInteractor import com.android.systemui.statusbar.notification.headsup.HeadsUpManager import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager +import com.android.systemui.testKosmos import com.android.systemui.util.concurrency.FakeExecutor import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.argumentCaptor @@ -74,7 +74,7 @@ import org.mockito.junit.MockitoJUnit @SmallTest @RunWith(AndroidJUnit4::class) class BackActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val executor = FakeExecutor(FakeSystemClock()) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraAutoRotateRepositoryImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraAutoRotateRepositoryImplTest.kt index 648d74d20cc5..29a0b6922b2f 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraAutoRotateRepositoryImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraAutoRotateRepositoryImplTest.kt @@ -22,8 +22,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectValues -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.android.systemui.util.settings.fakeSettings import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent @@ -34,7 +34,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class CameraAutoRotateRepositoryImplTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val settings = kosmos.fakeSettings private val testUser = UserHandle.of(1) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraSensorPrivacyRepositoryImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraSensorPrivacyRepositoryImplTest.kt index b73a212c9bd1..2e357d8a8652 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraSensorPrivacyRepositoryImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/CameraSensorPrivacyRepositoryImplTest.kt @@ -22,8 +22,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.mock import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent @@ -38,7 +38,7 @@ import org.mockito.Mockito @RunWith(AndroidJUnit4::class) @android.platform.test.annotations.EnabledOnRavenwood class CameraSensorPrivacyRepositoryImplTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val testUser = UserHandle.of(1) private val privacyManager = mock<SensorPrivacyManager>() @@ -46,7 +46,7 @@ class CameraSensorPrivacyRepositoryImplTest : SysuiTestCase() { CameraSensorPrivacyRepositoryImpl( testScope.testScheduler, testScope.backgroundScope, - privacyManager + privacyManager, ) @Test @@ -87,7 +87,7 @@ class CameraSensorPrivacyRepositoryImplTest : SysuiTestCase() { .addSensorPrivacyListener( ArgumentMatchers.eq(SensorPrivacyManager.Sensors.CAMERA), ArgumentMatchers.eq(testUser.identifier), - captor.capture() + captor.capture(), ) val sensorPrivacyCallback = captor.value!! diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraAutoRotateRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraAutoRotateRepositoryTest.kt index 6c8097ed7166..b3d898396497 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraAutoRotateRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraAutoRotateRepositoryTest.kt @@ -21,7 +21,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectValues -import com.android.systemui.kosmos.Kosmos +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest @@ -32,7 +32,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @android.platform.test.annotations.EnabledOnRavenwood class FakeCameraAutoRotateRepositoryTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val underTest = kosmos.fakeCameraAutoRotateRepository private val testUser = UserHandle.of(1) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraSensorPrivacyRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraSensorPrivacyRepositoryTest.kt index 7161c2c13a60..6b9a7de2e781 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraSensorPrivacyRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/camera/data/repository/FakeCameraSensorPrivacyRepositoryTest.kt @@ -21,7 +21,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectValues -import com.android.systemui.kosmos.Kosmos +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest @@ -32,7 +32,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @android.platform.test.annotations.EnabledOnRavenwood class FakeCameraSensorPrivacyRepositoryTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val underTest = kosmos.fakeCameraSensorPrivacyRepository private val testUser = UserHandle.of(1) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryTest.kt index f2a6c11b872e..722976131caf 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/data/repository/ContextualEducationRepositoryTest.kt @@ -26,9 +26,9 @@ import com.android.systemui.coroutines.collectLastValue import com.android.systemui.education.data.model.EduDeviceConnectionTime import com.android.systemui.education.data.model.GestureEduModel import com.android.systemui.education.domain.interactor.mockEduInputManager -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import java.io.File import javax.inject.Provider @@ -48,7 +48,7 @@ import org.junit.runner.RunWith class ContextualEducationRepositoryTest : SysuiTestCase() { private lateinit var underTest: UserContextualEducationRepository - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val dsScopeProvider: Provider<CoroutineScope> = Provider { TestScope(kosmos.testDispatcher).backgroundScope @@ -70,7 +70,7 @@ class ContextualEducationRepositoryTest : SysuiTestCase() { testContext, dsScopeProvider, kosmos.mockEduInputManager, - kosmos.testDispatcher + kosmos.testDispatcher, ) underTest.setUser(testUserId) } @@ -109,7 +109,7 @@ class ContextualEducationRepositoryTest : SysuiTestCase() { lastEducationTime = kosmos.fakeEduClock.instant(), usageSessionStartTime = kosmos.fakeEduClock.instant(), userId = testUserId, - gestureType = BACK + gestureType = BACK, ) underTest.updateGestureEduModel(BACK) { newModel } val model by collectLastValue(underTest.readGestureEduModelFlow(BACK)) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/haptics/slider/HapticSliderPluginTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/haptics/slider/HapticSliderPluginTest.kt index 5030d1e49da0..0f75e57ce771 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/haptics/slider/HapticSliderPluginTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/haptics/slider/HapticSliderPluginTest.kt @@ -21,9 +21,9 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.haptics.msdl.msdlPlayer -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.statusbar.VibratorHelper +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.whenever import com.android.systemui.util.time.fakeSystemClock import com.google.common.truth.Truth.assertThat @@ -45,7 +45,7 @@ import org.mockito.junit.MockitoRule @RunWith(AndroidJUnit4::class) class HapticSliderPluginTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() @Rule @JvmField val mMockitoRule: MockitoRule = MockitoJUnit.rule() @Mock private lateinit var vibratorHelper: VibratorHelper diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/data/repository/UserInputDeviceRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/data/repository/UserInputDeviceRepositoryTest.kt index 798c5ab817a5..39b5e81345ee 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/data/repository/UserInputDeviceRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputdevice/data/repository/UserInputDeviceRepositoryTest.kt @@ -23,9 +23,9 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectValues import com.android.systemui.inputdevice.data.model.UserDeviceConnectionStatus import com.android.systemui.keyboard.data.repository.keyboardRepository -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.android.systemui.touchpad.data.repository.touchpadRepository import com.android.systemui.user.data.repository.fakeUserRepository import com.android.systemui.user.data.repository.userRepository @@ -41,7 +41,7 @@ import org.junit.runner.RunWith class UserInputDeviceRepositoryTest : SysuiTestCase() { private lateinit var underTest: UserInputDeviceRepository - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val keyboardRepository = kosmos.keyboardRepository private val touchpadRepository = kosmos.touchpadRepository @@ -54,7 +54,7 @@ class UserInputDeviceRepositoryTest : SysuiTestCase() { kosmos.testDispatcher, keyboardRepository, touchpadRepository, - kosmos.userRepository + kosmos.userRepository, ) userRepository.setUserInfos(USER_INFOS) } @@ -72,7 +72,7 @@ class UserInputDeviceRepositoryTest : SysuiTestCase() { assertThat(isAnyKeyboardConnected) .containsExactly( UserDeviceConnectionStatus(isConnected = true, USER_INFOS[0].id), - UserDeviceConnectionStatus(isConnected = true, USER_INFOS[1].id) + UserDeviceConnectionStatus(isConnected = true, USER_INFOS[1].id), ) .inOrder() } @@ -90,16 +90,13 @@ class UserInputDeviceRepositoryTest : SysuiTestCase() { assertThat(isAnyTouchpadConnected) .containsExactly( UserDeviceConnectionStatus(isConnected = true, USER_INFOS[0].id), - UserDeviceConnectionStatus(isConnected = true, USER_INFOS[1].id) + UserDeviceConnectionStatus(isConnected = true, USER_INFOS[1].id), ) .inOrder() } companion object { private val USER_INFOS = - listOf( - UserInfo(100, "First User", 0), - UserInfo(101, "Second User", 0), - ) + listOf(UserInfo(100, "First User", 0), UserInfo(101, "Second User", 0)) } } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/data/repository/InputMethodRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/data/repository/InputMethodRepositoryTest.kt index 274880b484cc..6bd0fb0e17a1 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/data/repository/InputMethodRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/data/repository/InputMethodRepositoryTest.kt @@ -23,9 +23,9 @@ import android.view.inputmethod.InputMethodSubtype import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.mock @@ -47,7 +47,7 @@ class InputMethodRepositoryTest : SysuiTestCase() { @Mock private lateinit var inputMethodManager: InputMethodManager - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private lateinit var underTest: InputMethodRepository @@ -72,7 +72,7 @@ class InputMethodRepositoryTest : SysuiTestCase() { inputMethodManager.getEnabledInputMethodSubtypeListAsUser( any(), anyBoolean(), - eq(USER_HANDLE) + eq(USER_HANDLE), ) ) .thenReturn(listOf()) @@ -97,7 +97,7 @@ class InputMethodRepositoryTest : SysuiTestCase() { inputMethodManager.getEnabledInputMethodSubtypeListAsUser( eq(selectedImiId), anyBoolean(), - eq(USER_HANDLE) + eq(USER_HANDLE), ) ) .thenReturn( @@ -125,7 +125,7 @@ class InputMethodRepositoryTest : SysuiTestCase() { verify(inputMethodManager) .showInputMethodPickerFromSystem( /* showAuxiliarySubtypes = */ eq(true), - /* displayId = */ eq(displayId) + /* displayId = */ eq(displayId), ) } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/domain/interactor/InputMethodInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/domain/interactor/InputMethodInteractorTest.kt index 8e6de2f04279..9e129a43b4cb 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/domain/interactor/InputMethodInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/inputmethod/domain/interactor/InputMethodInteractorTest.kt @@ -22,8 +22,8 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.inputmethod.data.model.InputMethodModel import com.android.systemui.inputmethod.data.repository.fakeInputMethodRepository import com.android.systemui.inputmethod.data.repository.inputMethodRepository -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import java.util.UUID import kotlinx.coroutines.test.runTest @@ -34,7 +34,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class InputMethodInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val fakeInputMethodRepository = kosmos.fakeInputMethodRepository @@ -148,7 +148,7 @@ class InputMethodInteractorTest : SysuiTestCase() { subtypes = List(auxiliarySubtypes + nonAuxiliarySubtypes) { InputMethodModel.Subtype(subtypeId = it, isAuxiliary = it < auxiliarySubtypes) - } + }, ) } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarterTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarterTest.kt index 1bb4805d4f16..655c646cd34c 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarterTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarterTest.kt @@ -34,7 +34,6 @@ import com.android.systemui.keyboard.shortcut.shortcutHelperMultiTaskingShortcut import com.android.systemui.keyboard.shortcut.shortcutHelperSystemShortcutsSource import com.android.systemui.keyboard.shortcut.shortcutHelperTestHelper import com.android.systemui.keyboard.shortcut.shortcutHelperViewModel -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.applicationCoroutineScope import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testDispatcher @@ -43,6 +42,7 @@ import com.android.systemui.plugins.activityStarter import com.android.systemui.settings.FakeUserTracker import com.android.systemui.settings.userTracker import com.android.systemui.statusbar.phone.systemUIDialogFactory +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runTest @@ -60,7 +60,7 @@ class ShortcutHelperDialogStarterTest : SysuiTestCase() { private val fakeMultiTaskingSource = FakeKeyboardShortcutGroupsSource() private val mockUserContext: Context = mock() private val kosmos = - Kosmos().also { + testKosmos().also { it.testCase = this it.testDispatcher = UnconfinedTestDispatcher() it.shortcutHelperSystemShortcutsSource = fakeSystemSource diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/StickyKeysIndicatorCoordinatorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/StickyKeysIndicatorCoordinatorTest.kt index be9e93c64053..ba57ffd37053 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/StickyKeysIndicatorCoordinatorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/StickyKeysIndicatorCoordinatorTest.kt @@ -26,7 +26,7 @@ import com.android.systemui.keyboard.stickykeys.StickyKeysLogger import com.android.systemui.keyboard.stickykeys.shared.model.Locked import com.android.systemui.keyboard.stickykeys.shared.model.ModifierKey.SHIFT import com.android.systemui.keyboard.stickykeys.ui.viewmodel.StickyKeysIndicatorViewModel -import com.android.systemui.kosmos.Kosmos +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever @@ -52,19 +52,19 @@ class StickyKeysIndicatorCoordinatorTest : SysuiTestCase() { fun setup() { val dialogFactory = mock<StickyKeyDialogFactory>() whenever(dialogFactory.create(any())).thenReturn(dialog) - val keyboardRepository = Kosmos().keyboardRepository + val keyboardRepository = testKosmos().keyboardRepository val viewModel = StickyKeysIndicatorViewModel( stickyKeysRepository, keyboardRepository, - testScope.backgroundScope + testScope.backgroundScope, ) coordinator = StickyKeysIndicatorCoordinator( testScope.backgroundScope, dialogFactory, viewModel, - mock<StickyKeysLogger>() + mock<StickyKeysLogger>(), ) coordinator.startListening() keyboardRepository.setIsAnyKeyboardConnected(true) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/viewmodel/StickyKeysIndicatorViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/viewmodel/StickyKeysIndicatorViewModelTest.kt index 9daf0ffd34b4..1c0041969504 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/viewmodel/StickyKeysIndicatorViewModelTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/stickykeys/ui/viewmodel/StickyKeysIndicatorViewModelTest.kt @@ -33,7 +33,6 @@ import com.android.systemui.keyboard.stickykeys.shared.model.ModifierKey.ALT_GR import com.android.systemui.keyboard.stickykeys.shared.model.ModifierKey.CTRL import com.android.systemui.keyboard.stickykeys.shared.model.ModifierKey.META import com.android.systemui.keyboard.stickykeys.shared.model.ModifierKey.SHIFT -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope import com.android.systemui.testKosmos @@ -64,7 +63,7 @@ class StickyKeysIndicatorViewModelTest : SysuiTestCase() { private val inputManager = mock<InputManager>() private val keyboardRepository = FakeKeyboardRepository() private val secureSettings = kosmos.fakeSettings - private val userRepository = Kosmos().fakeUserRepository + private val userRepository = testKosmos().fakeUserRepository private val captor = ArgumentCaptor.forClass(InputManager.StickyModifierStateListener::class.java) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt index baf3b5b4430f..3f1cadc5fe76 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt @@ -23,12 +23,12 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.defaultDeviceState import com.android.systemui.deviceStateManager import com.android.systemui.flags.FeatureFlags -import com.android.systemui.kosmos.Kosmos import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController import com.android.systemui.statusbar.NotificationShadeWindowController import com.android.systemui.statusbar.SysuiStatusBarStateController import com.android.systemui.statusbar.phone.BiometricUnlockController import com.android.systemui.statusbar.policy.KeyguardStateController +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.argThat import java.util.function.Predicate @@ -68,7 +68,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { @Mock private lateinit var notificationShadeWindowController: NotificationShadeWindowController @Mock private lateinit var powerManager: PowerManager @Mock private lateinit var wallpaperManager: WallpaperManager - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val deviceStateManager = kosmos.deviceStateManager @Mock @@ -92,7 +92,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { surfaceControl1, Rect(), mock(ActivityManager.RunningTaskInfo::class.java), - false + false, ) private var surfaceControl2 = mock(SurfaceControl::class.java) @@ -113,7 +113,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { surfaceControl2, Rect(), mock(ActivityManager.RunningTaskInfo::class.java), - false + false, ) private lateinit var remoteAnimationTargets: Array<RemoteAnimationTarget> @@ -135,7 +135,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { surfaceControlWp, Rect(), mock(ActivityManager.RunningTaskInfo::class.java), - false + false, ) private lateinit var wallpaperTargets: Array<RemoteAnimationTarget> @@ -157,7 +157,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { surfaceControlLockWp, Rect(), mock(ActivityManager.RunningTaskInfo::class.java), - false + false, ) private lateinit var lockWallpaperTargets: Array<RemoteAnimationTarget> private var shouldPerformSmartspaceTransition = false @@ -179,14 +179,14 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { notificationShadeWindowController, powerManager, wallpaperManager, - deviceStateManager + deviceStateManager, ) { override fun shouldPerformSmartspaceTransition(): Boolean = shouldPerformSmartspaceTransition } keyguardUnlockAnimationController.setLauncherUnlockController( "", - launcherUnlockAnimationController + launcherUnlockAnimationController, ) whenever(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java)) @@ -227,7 +227,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { arrayOf(), arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) val captorSb = ArgThatCaptor<SyncRtSurfaceTransactionApplier.SurfaceParams>() @@ -259,7 +259,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) // Since the animation is running, we should not have finished the remote animation. @@ -282,7 +282,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) verify(listener).onUnlockAnimationStarted(any(), eq(true), any(), any()) @@ -303,7 +303,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) verify(listener).onUnlockAnimationStarted(any(), eq(false), any(), any()) @@ -327,7 +327,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - true /* requestedShowSurfaceBehindKeyguard */ + true, /* requestedShowSurfaceBehindKeyguard */ ) assertTrue(keyguardUnlockAnimationController.surfaceBehindAlphaAnimator.isRunning) @@ -351,7 +351,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - true /* requestedShowSurfaceBehindKeyguard */ + true, /* requestedShowSurfaceBehindKeyguard */ ) assertTrue(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) @@ -373,7 +373,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) assertTrue(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) @@ -389,7 +389,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - true /* requestedShowSurfaceBehindKeyguard */ + true, /* requestedShowSurfaceBehindKeyguard */ ) assertFalse(keyguardUnlockAnimationController.canPerformInWindowLauncherAnimations()) @@ -406,7 +406,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) assertTrue(keyguardUnlockAnimationController.isPlayingCannedUnlockAnimation()) @@ -427,7 +427,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, lockWallpaperTargets, 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) for (i in 0..10) { @@ -471,7 +471,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) // Cancel the animator so we can verify only the setSurfaceBehind call below. @@ -492,7 +492,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { val captorWp = ArgThatCaptor<SyncRtSurfaceTransactionApplier.SurfaceParams>() verify( surfaceTransactionApplier, - times(1).description("WallpaperSurface was expected to receive scheduleApply once") + times(1).description("WallpaperSurface was expected to receive scheduleApply once"), ) .scheduleApply(captorWp.capture { sp -> sp.surface == surfaceControlWp }) @@ -523,7 +523,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) // Cancel the animator so we can verify only the setSurfaceBehind call below. @@ -539,7 +539,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { val captorWp = ArgThatCaptor<SyncRtSurfaceTransactionApplier.SurfaceParams>() verify( surfaceTransactionApplier, - atLeastOnce().description("Wallpaper surface has not " + "received scheduleApply") + atLeastOnce().description("Wallpaper surface has not " + "received scheduleApply"), ) .scheduleApply(captorWp.capture { sp -> sp.surface == surfaceControlWp }) @@ -562,7 +562,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { wallpaperTargets, arrayOf(), 0 /* startTime */, - false /* requestedShowSurfaceBehindKeyguard */ + false, /* requestedShowSurfaceBehindKeyguard */ ) // Stop the animator - we just want to test whether the override is not applied. @@ -578,7 +578,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { val captorWp = ArgThatCaptor<SyncRtSurfaceTransactionApplier.SurfaceParams>() verify( surfaceTransactionApplier, - atLeastOnce().description("Wallpaper surface has not " + "received scheduleApply") + atLeastOnce().description("Wallpaper surface has not " + "received scheduleApply"), ) .scheduleApply(captorWp.capture { sp -> sp.surface == surfaceControlWp }) @@ -588,7 +588,7 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() { assertEquals( "Wallpaper surface was expected to have opacity 1", 1f, - captorWp.getLastValue().alpha + captorWp.getLastValue().alpha, ) verifyNoMoreInteractions(surfaceTransactionApplier) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/mediarouter/data/repository/MediaRouterRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/mediarouter/data/repository/MediaRouterRepositoryTest.kt index 6bc8000b0519..04f7fe1a6487 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/mediarouter/data/repository/MediaRouterRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/mediarouter/data/repository/MediaRouterRepositoryTest.kt @@ -21,10 +21,10 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.statusbar.policy.CastDevice import com.android.systemui.statusbar.policy.fakeCastController +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import kotlinx.coroutines.test.runCurrent @@ -34,7 +34,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class MediaRouterRepositoryTest : SysuiTestCase() { - val kosmos = Kosmos() + val kosmos = testKosmos() val testScope = kosmos.testScope val castController = kosmos.fakeCastController diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/UserSettingObserverTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/UserSettingObserverTest.kt index 858ed6a6b54a..473d7b6d0dfa 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/UserSettingObserverTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/UserSettingObserverTest.kt @@ -22,8 +22,8 @@ import android.testing.TestableLooper import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.android.systemui.util.settings.SecureSettings import com.android.systemui.util.settings.fakeSettings import com.google.common.truth.Truth.assertThat @@ -64,7 +64,7 @@ class UserSettingObserverTest(flags: FlagsParameterization) : SysuiTestCase() { mSetFlagsRule.setFlagsParameterization(flags) } - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private lateinit var testableLooper: TestableLooper @@ -85,7 +85,7 @@ class UserSettingObserverTest(flags: FlagsParameterization) : SysuiTestCase() { Handler(testableLooper.looper), TEST_SETTING, USER, - DEFAULT_VALUE + DEFAULT_VALUE, ) { override fun handleValueChanged(value: Int, observedChange: Boolean) { callback(value, observedChange) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/WorkTileAutoAddableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/WorkTileAutoAddableTest.kt index 00490427f80b..a2829b5f42cd 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/WorkTileAutoAddableTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/autoaddable/WorkTileAutoAddableTest.kt @@ -27,7 +27,6 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.coroutines.collectValues -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.pipeline.data.model.RestoreData import com.android.systemui.qs.pipeline.data.model.RestoreProcessor import com.android.systemui.qs.pipeline.data.model.workTileRestoreProcessor @@ -36,6 +35,7 @@ import com.android.systemui.qs.pipeline.domain.model.AutoAddTracking import com.android.systemui.qs.pipeline.shared.TileSpec import com.android.systemui.qs.tiles.WorkModeTile import com.android.systemui.settings.FakeUserTracker +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest @@ -47,7 +47,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class WorkTileAutoAddableTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val restoreProcessor: RestoreProcessor get() = kosmos.workTileRestoreProcessor @@ -62,7 +62,7 @@ class WorkTileAutoAddableTest : SysuiTestCase() { FakeUserTracker( _userId = USER_INFO_0.id, _userInfo = USER_INFO_0, - _userProfiles = listOf(USER_INFO_0) + _userProfiles = listOf(USER_INFO_0), ) underTest = WorkTileAutoAddable(userTracker, kosmos.workTileRestoreProcessor) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/NoLowNumberOfTilesTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/NoLowNumberOfTilesTest.kt index 3a9c3d066b23..4e0adcab8ea3 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/NoLowNumberOfTilesTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/NoLowNumberOfTilesTest.kt @@ -22,7 +22,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.MediumTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.plugins.qs.QSTile import com.android.systemui.qs.FakeQSFactory @@ -39,6 +38,7 @@ import com.android.systemui.qs.pipeline.shared.TileSpec import com.android.systemui.qs.qsTileFactory import com.android.systemui.settings.fakeUserTracker import com.android.systemui.settings.userTracker +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest @@ -55,22 +55,12 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class NoLowNumberOfTilesTest : SysuiTestCase() { - private val USER_0_INFO = - UserInfo( - 0, - "zero", - "", - UserInfo.FLAG_ADMIN or UserInfo.FLAG_FULL, - ) + private val USER_0_INFO = UserInfo(0, "zero", "", UserInfo.FLAG_ADMIN or UserInfo.FLAG_FULL) - private val defaultTiles = - listOf( - TileSpec.create("internet"), - TileSpec.create("bt"), - ) + private val defaultTiles = listOf(TileSpec.create("internet"), TileSpec.create("bt")) private val kosmos = - Kosmos().apply { + testKosmos().apply { fakeMinimumTilesRepository = MinimumTilesFixedRepository(minNumberOfTiles = 2) fakeUserTracker.set(listOf(USER_0_INFO), 0) qsTileFactory = FakeQSFactory(::tileCreator) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/WorkProfileAutoAddedAfterRestoreTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/WorkProfileAutoAddedAfterRestoreTest.kt index 9d9bfda99bd9..77030aceb477 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/WorkProfileAutoAddedAfterRestoreTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/pipeline/domain/interactor/WorkProfileAutoAddedAfterRestoreTest.kt @@ -22,7 +22,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.MediumTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.plugins.qs.QSTile import com.android.systemui.qs.FakeQSFactory @@ -34,6 +33,7 @@ import com.android.systemui.qs.pipeline.shared.TileSpec import com.android.systemui.qs.qsTileFactory import com.android.systemui.settings.fakeUserTracker import com.android.systemui.settings.userTracker +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runCurrent @@ -52,7 +52,9 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class WorkProfileAutoAddedAfterRestoreTest : SysuiTestCase() { - private val kosmos by lazy { Kosmos().apply { fakeUserTracker.set(listOf(USER_0_INFO), 0) } } + private val kosmos by lazy { + testKosmos().apply { fakeUserTracker.set(listOf(USER_0_INFO), 0) } + } // Getter here so it can change when there is a managed profile. private val workTileAvailable: Boolean get() = hasManagedProfile() @@ -143,30 +145,15 @@ class WorkProfileAutoAddedAfterRestoreTest : SysuiTestCase() { } private fun TestScope.createManagedProfileAndAdd() { - kosmos.fakeUserTracker.set( - listOf(USER_0_INFO, MANAGED_USER_INFO), - 0, - ) + kosmos.fakeUserTracker.set(listOf(USER_0_INFO, MANAGED_USER_INFO), 0) runCurrent() } private companion object { val WORK_TILE_SPEC = "work".toTileSpec() - val USER_0_INFO = - UserInfo( - 0, - "zero", - "", - UserInfo.FLAG_ADMIN or UserInfo.FLAG_FULL, - ) + val USER_0_INFO = UserInfo(0, "zero", "", UserInfo.FLAG_ADMIN or UserInfo.FLAG_FULL) val MANAGED_USER_INFO = - UserInfo( - 10, - "ten-managed", - "", - 0, - UserManager.USER_TYPE_PROFILE_MANAGED, - ) + UserInfo(10, "ten-managed", "", 0, UserManager.USER_TYPE_PROFILE_MANAGED) fun String.toTileSpec() = TileSpec.create(this) } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/AirplaneModeMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/AirplaneModeMapperTest.kt index 557f4ea262a3..311f1f792bba 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/AirplaneModeMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/AirplaneModeMapperTest.kt @@ -23,13 +23,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.airplane.domain.AirplaneModeMapper import com.android.systemui.qs.tiles.impl.airplane.domain.model.AirplaneModeTileModel import com.android.systemui.qs.tiles.impl.airplane.qsAirplaneModeTileConfig import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -37,7 +37,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class AirplaneModeMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val airplaneModeConfig = kosmos.qsAirplaneModeTileConfig private lateinit var mapper: AirplaneModeMapper diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/alarm/domain/AlarmTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/alarm/domain/AlarmTileMapperTest.kt index 24e46686e23d..bb58ecaa2566 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/alarm/domain/AlarmTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/alarm/domain/AlarmTileMapperTest.kt @@ -23,12 +23,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.alarm.domain.model.AlarmTileModel import com.android.systemui.qs.tiles.impl.alarm.qsAlarmTileConfig import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import com.android.systemui.util.time.FakeSystemClock import java.time.Instant import java.time.LocalDateTime @@ -41,7 +41,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class AlarmTileMapperTest : SysuiTestCase() { private val oneMinute = 60000L - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val alarmTileConfig = kosmos.qsAlarmTileConfig private val fakeClock = FakeSystemClock() // Using lazy (versus =) to make sure we override the right context -- see b/311612168 diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/doman/interactor/BatterySaverTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/doman/interactor/BatterySaverTileDataInteractorTest.kt index 44c175ab7156..1ef1a72b7483 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/doman/interactor/BatterySaverTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/doman/interactor/BatterySaverTileDataInteractorTest.kt @@ -23,10 +23,10 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger import com.android.systemui.qs.tiles.impl.battery.domain.interactor.BatterySaverTileDataInteractor +import com.android.systemui.testKosmos import com.android.systemui.utils.leaks.FakeBatteryController import com.google.common.truth.Truth import kotlinx.coroutines.flow.flowOf @@ -40,7 +40,7 @@ import org.junit.runner.RunWith @EnabledOnRavenwood @RunWith(AndroidJUnit4::class) class BatterySaverTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val batteryController = FakeBatteryController(LeakCheck()) private val testUser = UserHandle.of(1) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/ui/BatterySaverTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/ui/BatterySaverTileMapperTest.kt index 2ddaddd5ad35..cb50ec9a70f4 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/ui/BatterySaverTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/battery/ui/BatterySaverTileMapperTest.kt @@ -22,12 +22,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.battery.domain.model.BatterySaverTileModel import com.android.systemui.qs.tiles.impl.battery.qsBatterySaverTileConfig import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -35,7 +35,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class BatterySaverTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val batterySaverTileConfig = kosmos.qsBatterySaverTileConfig private lateinit var mapper: BatterySaverTileMapper diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/colorcorrection/domain/ColorCorrectionTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/colorcorrection/domain/ColorCorrectionTileMapperTest.kt index a3c159820a94..bcd443cc78e1 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/colorcorrection/domain/ColorCorrectionTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/colorcorrection/domain/ColorCorrectionTileMapperTest.kt @@ -22,19 +22,19 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.colorcorrection.domain.model.ColorCorrectionTileModel import com.android.systemui.qs.tiles.impl.colorcorrection.qsColorCorrectionTileConfig import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class ColorCorrectionTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val colorCorrectionTileConfig = kosmos.qsColorCorrectionTileConfig private val subtitleArray by lazy { context.resources.getStringArray(R.array.tile_states_color_correction) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/custom/data/repository/CustomTileRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/custom/data/repository/CustomTileRepositoryTest.kt index 83e61d1b36bf..3c0e7d51b4e8 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/custom/data/repository/CustomTileRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/custom/data/repository/CustomTileRepositoryTest.kt @@ -24,7 +24,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectValues -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.external.TileServiceKey import com.android.systemui.qs.pipeline.shared.TileSpec @@ -34,6 +33,7 @@ import com.android.systemui.qs.tiles.impl.custom.customTileSpec import com.android.systemui.qs.tiles.impl.custom.customTileStatePersister import com.android.systemui.qs.tiles.impl.custom.data.entity.CustomTileDefaults import com.android.systemui.qs.tiles.impl.custom.packageManagerAdapterFacade +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.runCurrent @@ -45,7 +45,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class CustomTileRepositoryTest : SysuiTestCase() { - private val kosmos = Kosmos().apply { customTileSpec = TileSpec.create(TEST_COMPONENT) } + private val kosmos = testKosmos().apply { customTileSpec = TileSpec.create(TEST_COMPONENT) } private val underTest: CustomTileRepository = with(kosmos) { CustomTileRepositoryImpl( @@ -213,7 +213,7 @@ class CustomTileRepositoryTest : SysuiTestCase() { underTest.updateWithTile( TEST_USER_1, Tile().apply { subtitle = "test_subtitle" }, - true + true, ) runCurrent() @@ -247,7 +247,7 @@ class CustomTileRepositoryTest : SysuiTestCase() { underTest.updateWithTile( TEST_USER_1, Tile().apply { subtitle = "test_subtitle" }, - true + true, ) runCurrent() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/flashlight/domain/FlashlightMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/flashlight/domain/FlashlightMapperTest.kt index a115c1235210..2da144e5ee98 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/flashlight/domain/FlashlightMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/flashlight/domain/FlashlightMapperTest.kt @@ -21,11 +21,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.flashlight.domain.model.FlashlightTileModel import com.android.systemui.qs.tiles.impl.flashlight.qsFlashlightTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import junit.framework.Assert.assertEquals import org.junit.Test @@ -34,7 +34,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class FlashlightMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val qsTileConfig = kosmos.qsFlashlightTileConfig private val mapper by lazy { FlashlightMapper( diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/FontScalingTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/FontScalingTileMapperTest.kt index 8f8f7105415f..45720b86a859 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/FontScalingTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/FontScalingTileMapperTest.kt @@ -22,19 +22,19 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.fontscaling.domain.model.FontScalingTileModel import com.android.systemui.qs.tiles.impl.fontscaling.qsFontScalingTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class FontScalingTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val fontScalingTileConfig = kosmos.qsFontScalingTileConfig private val mapper by lazy { diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/interactor/FontScalingUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/interactor/FontScalingUserActionInteractorTest.kt index 9bd4895ac21c..93f2bc34372e 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/interactor/FontScalingUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/fontscaling/domain/interactor/FontScalingUserActionInteractorTest.kt @@ -26,7 +26,6 @@ import com.android.systemui.accessibility.fontscaling.FontScalingDialogDelegate import com.android.systemui.animation.DialogTransitionAnimator import com.android.systemui.animation.Expandable import com.android.systemui.animation.LaunchableView -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.plugins.ActivityStarter import com.android.systemui.qs.shared.QSSettingsPackageRepository @@ -37,6 +36,7 @@ import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx.click import com.android.systemui.qs.tiles.impl.fontscaling.domain.model.FontScalingTileModel import com.android.systemui.statusbar.phone.FakeKeyguardStateController import com.android.systemui.statusbar.phone.SystemUIDialog +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest import org.junit.Before @@ -67,7 +67,7 @@ class FontScalingUserActionInteractorTest : SysuiTestCase() { @Captor private lateinit var argumentCaptor: ArgumentCaptor<Runnable> - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val scope = kosmos.testScope private val qsTileIntentUserActionHandler = FakeQSTileIntentUserInputHandler() private val keyguardStateController = FakeKeyguardStateController() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/HearingDevicesTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/HearingDevicesTileMapperTest.kt index 3d3447da15a1..c41034202c88 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/HearingDevicesTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/HearingDevicesTileMapperTest.kt @@ -21,19 +21,19 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.hearingdevices.domain.model.HearingDevicesTileModel import com.android.systemui.qs.tiles.impl.hearingdevices.qsHearingDevicesTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class HearingDevicesTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val qsTileConfig = kosmos.qsHearingDevicesTileConfig private val mapper by lazy { HearingDevicesTileMapper( diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileDataInteractorTest.kt index 4b9d11d2f706..4d38e7588578 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileDataInteractorTest.kt @@ -24,11 +24,11 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.accessibility.hearingaid.HearingDevicesChecker import com.android.systemui.coroutines.collectLastValue import com.android.systemui.coroutines.collectValues -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger import com.android.systemui.qs.tiles.impl.hearingdevices.domain.model.HearingDevicesTileModel import com.android.systemui.statusbar.policy.fakeBluetoothController +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.runCurrent @@ -46,7 +46,7 @@ import org.mockito.kotlin.whenever @EnabledOnRavenwood @RunWith(AndroidJUnit4::class) class HearingDevicesTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val testUser = UserHandle.of(1) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileUserActionInteractorTest.kt index 1b497a2b36ed..0ba057b1881b 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/hearingdevices/domain/interactor/HearingDevicesTileUserActionInteractorTest.kt @@ -22,13 +22,13 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.accessibility.hearingaid.HearingDevicesDialogManager import com.android.systemui.accessibility.hearingaid.HearingDevicesUiEventLogger.Companion.LAUNCH_SOURCE_QS_TILE -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.shared.QSSettingsPackageRepository import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandler import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandlerSubject import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx import com.android.systemui.qs.tiles.impl.hearingdevices.domain.model.HearingDevicesTileModel +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest import org.junit.Before @@ -47,7 +47,7 @@ import org.mockito.kotlin.whenever @EnabledOnRavenwood @RunWith(AndroidJUnit4::class) class HearingDevicesTileUserActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val inputHandler = FakeQSTileIntentUserInputHandler() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/InternetTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/InternetTileMapperTest.kt index 54a653df696f..e15664eba6b9 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/InternetTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/InternetTileMapperTest.kt @@ -28,7 +28,6 @@ import com.android.systemui.common.shared.model.ContentDescription.Companion.loa import com.android.systemui.common.shared.model.Icon import com.android.systemui.common.shared.model.Text import com.android.systemui.common.shared.model.Text.Companion.loadText -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.internet.domain.model.InternetTileModel import com.android.systemui.qs.tiles.impl.internet.qsInternetTileConfig @@ -38,13 +37,14 @@ import com.android.systemui.statusbar.connectivity.WifiIcons.WIFI_FULL_ICONS import com.android.systemui.statusbar.pipeline.mobile.domain.model.SignalIconModel import com.android.systemui.statusbar.pipeline.satellite.ui.model.SatelliteIconModel import com.android.systemui.statusbar.pipeline.shared.ui.model.InternetTileIconModel +import com.android.systemui.testKosmos import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class InternetTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val internetTileConfig = kosmos.qsInternetTileConfig private val handler = kosmos.fakeExecutorHandler private val mapper by lazy { diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt index 63607f1edd59..45582f017fb0 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileDataInteractorTest.kt @@ -29,7 +29,6 @@ import com.android.systemui.common.shared.model.Text.Companion.loadText import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.FakeFeatureFlagsClassic import com.android.systemui.flags.Flags -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.log.table.logcatTableLogBuffer import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger @@ -54,6 +53,7 @@ import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiNetworkMode import com.android.systemui.statusbar.pipeline.wifi.shared.model.WifiScanEntry import com.android.systemui.statusbar.pipeline.wifi.ui.model.WifiIcon import com.android.systemui.statusbar.policy.data.repository.FakeUserSetupRepository +import com.android.systemui.testKosmos import com.android.systemui.util.CarrierConfigTracker import com.android.systemui.util.mockito.mock import com.google.common.truth.Truth.assertThat @@ -67,7 +67,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class InternetTileDataInteractorTest : SysuiTestCase() { private val testUser = UserHandle.of(1) - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private lateinit var underTest: InternetTileDataInteractor diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt index 261e3de939f2..d019a456a4f5 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/internet/domain/interactor/InternetTileUserActionInteractorTest.kt @@ -21,7 +21,6 @@ import android.provider.Settings import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandler import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandlerSubject @@ -29,6 +28,7 @@ import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx import com.android.systemui.qs.tiles.dialog.InternetDialogManager import com.android.systemui.qs.tiles.impl.internet.domain.model.InternetTileModel import com.android.systemui.statusbar.connectivity.AccessPointController +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.nullable import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest @@ -44,7 +44,7 @@ import org.mockito.kotlin.verify @EnabledOnRavenwood @RunWith(AndroidJUnit4::class) class InternetTileUserActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val inputHandler = FakeQSTileIntentUserInputHandler() private lateinit var underTest: InternetTileUserActionInteractor diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/inversion/domain/ColorInversionTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/inversion/domain/ColorInversionTileMapperTest.kt index 780d58c83e5b..48e114603723 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/inversion/domain/ColorInversionTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/inversion/domain/ColorInversionTileMapperTest.kt @@ -22,20 +22,20 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tileimpl.SubtitleArrayMapping import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.inversion.domain.model.ColorInversionTileModel import com.android.systemui.qs.tiles.impl.inversion.qsColorInversionTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class ColorInversionTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val colorInversionTileConfig = kosmos.qsColorInversionTileConfig private val subtitleArrayId = SubtitleArrayMapping.getSubtitleId(colorInversionTileConfig.tileSpec.spec) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingDataInteractorTest.kt index 7562ac00e4a6..57f85bd8c5ac 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingDataInteractorTest.kt @@ -22,13 +22,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger import com.android.systemui.recordissue.IssueRecordingState import com.android.systemui.settings.fakeUserFileManager import com.android.systemui.settings.userTracker +import com.android.systemui.testKosmos import com.android.systemui.util.settings.fakeGlobalSettings import com.google.common.truth.Truth import kotlinx.coroutines.flow.flowOf @@ -42,7 +42,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class IssueRecordingDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val userTracker = kosmos.userTracker private val userFileManager = kosmos.fakeUserFileManager private val testUser = UserHandle.of(1) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt index fa6d8bf4a317..0201168181a9 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingMapperTest.kt @@ -20,7 +20,6 @@ import android.content.res.mainResources import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.qs.pipeline.shared.TileSpec import com.android.systemui.qs.qsEventLogger @@ -30,6 +29,7 @@ import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.qs.tiles.viewmodel.QSTileUIConfig import com.android.systemui.recordissue.RecordIssueModule import com.android.systemui.res.R +import com.android.systemui.testKosmos import com.google.common.truth.Truth import org.junit.Test import org.junit.runner.RunWith @@ -37,7 +37,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class IssueRecordingMapperTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val uiConfig = QSTileUIConfig.Resource(R.drawable.qs_record_issue_icon_off, R.string.qs_record_issue_label) private val config = diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt index 9c2be899b8ca..125419ba3bdf 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/irecording/IssueRecordingUserActionInteractorTest.kt @@ -22,7 +22,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.animation.dialogTransitionAnimator -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope @@ -39,6 +38,7 @@ import com.android.systemui.settings.userFileManager import com.android.systemui.settings.userTracker import com.android.systemui.statusbar.phone.KeyguardDismissUtil import com.android.systemui.statusbar.policy.keyguardStateController +import com.android.systemui.testKosmos import com.android.systemui.util.settings.fakeGlobalSettings import com.google.common.truth.Truth import kotlinx.coroutines.test.runTest @@ -56,7 +56,7 @@ class IssueRecordingUserActionInteractorTest : SysuiTestCase() { @Mock private lateinit var recordingController: RecordingController val user = UserHandle(1) - val kosmos = Kosmos().also { it.testCase = this } + val kosmos = testKosmos().also { it.testCase = this } private lateinit var userContextProvider: UserContextProvider private lateinit var underTest: IssueRecordingUserActionInteractor diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/domain/LocationTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/domain/LocationTileMapperTest.kt index 4ebe23dcdef1..a6ad54935f08 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/domain/LocationTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/domain/LocationTileMapperTest.kt @@ -21,11 +21,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.location.domain.model.LocationTileModel import com.android.systemui.qs.tiles.impl.location.qsLocationTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import com.google.common.truth.Truth import junit.framework.Assert import org.junit.Test @@ -34,7 +34,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class LocationTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val qsTileConfig = kosmos.qsLocationTileConfig private val mapper by lazy { diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/interactor/LocationTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/interactor/LocationTileUserActionInteractorTest.kt index 8b21cb4a97d5..435aea07c9a0 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/interactor/LocationTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/location/interactor/LocationTileUserActionInteractorTest.kt @@ -21,7 +21,6 @@ import android.provider.Settings import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.plugins.ActivityStarter import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandler @@ -32,6 +31,7 @@ import com.android.systemui.qs.tiles.impl.location.domain.interactor.LocationTil import com.android.systemui.qs.tiles.impl.location.domain.model.LocationTileModel import com.android.systemui.statusbar.phone.FakeKeyguardStateController import com.android.systemui.statusbar.policy.LocationController +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.coroutines.EmptyCoroutineContext import kotlinx.coroutines.test.runTest @@ -58,7 +58,7 @@ class LocationTileUserActionInteractorTest : SysuiTestCase() { @Before fun setup() { MockitoAnnotations.initMocks(this) - val kosmos = Kosmos() + val kosmos = testKosmos() underTest = LocationTileUserActionInteractor( EmptyCoroutineContext, diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileDataInteractorTest.kt index a0aa2d4a9a6c..a5e2922ffb3d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileDataInteractorTest.kt @@ -26,7 +26,7 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.accessibility.data.repository.NightDisplayRepository import com.android.systemui.coroutines.collectLastValue import com.android.systemui.dagger.NightDisplayListenerModule -import com.android.systemui.kosmos.Kosmos +import com.android.systemui.testKosmos import com.android.systemui.user.utils.UserScopedService import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.mock @@ -47,7 +47,7 @@ import org.mockito.ArgumentMatchers.anyInt @SmallTest @RunWith(AndroidJUnit4::class) class NightDisplayTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testUser = UserHandle.of(1)!! private val testStartTime = LocalTime.MIDNIGHT private val testEndTime = LocalTime.NOON diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileUserActionInteractorTest.kt index adc8bcba5a5c..51975b0508a9 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/domain/interactor/NightDisplayTileUserActionInteractorTest.kt @@ -26,12 +26,12 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.accessibility.data.repository.NightDisplayRepository import com.android.systemui.dagger.NightDisplayListenerModule -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandler import com.android.systemui.qs.tiles.base.actions.intentInputs import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx import com.android.systemui.qs.tiles.impl.custom.qsTileLogger import com.android.systemui.qs.tiles.impl.night.domain.model.NightDisplayTileModel +import com.android.systemui.testKosmos import com.android.systemui.user.utils.UserScopedService import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.mock @@ -51,7 +51,7 @@ import org.mockito.Mockito.verify @SmallTest @RunWith(AndroidJUnit4::class) class NightDisplayTileUserActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val qsTileIntentUserActionHandler = FakeQSTileIntentUserInputHandler() private val testUser = UserHandle.of(1) private val colorDisplayManager = @@ -89,7 +89,7 @@ class NightDisplayTileUserActionInteractorTest : SysuiTestCase() { NightDisplayTileUserActionInteractor( nightDisplayRepository, qsTileIntentUserActionHandler, - kosmos.qsTileLogger + kosmos.qsTileLogger, ) @Test @@ -143,7 +143,7 @@ class NightDisplayTileUserActionInteractorTest : SysuiTestCase() { underTest.handleInput( QSTileInputTestKtx.longClick( NightDisplayTileModel.AutoModeOff(enabledState, false), - testUser + testUser, ) ) @@ -163,7 +163,7 @@ class NightDisplayTileUserActionInteractorTest : SysuiTestCase() { underTest.handleInput( QSTileInputTestKtx.longClick( NightDisplayTileModel.AutoModeOff(enabledState, false), - testUser + testUser, ) ) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/ui/NightDisplayTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/ui/NightDisplayTileMapperTest.kt index 7c853261aa1c..0b0b88e455da 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/ui/NightDisplayTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/night/ui/NightDisplayTileMapperTest.kt @@ -24,13 +24,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.base.logging.QSTileLogger import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.night.domain.model.NightDisplayTileModel import com.android.systemui.qs.tiles.impl.night.qsNightDisplayTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.mock import java.time.LocalTime import java.time.format.DateTimeFormatter @@ -41,7 +41,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class NightDisplayTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val config = kosmos.qsNightDisplayTileConfig private val testStartTime = LocalTime.MIDNIGHT diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/NotesTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/NotesTileMapperTest.kt index b6caa22a3012..ecf6f2a9cd1d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/NotesTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/NotesTileMapperTest.kt @@ -22,19 +22,19 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.notes.domain.model.NotesTileModel import com.android.systemui.qs.tiles.impl.notes.qsNotesTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import kotlin.test.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class NotesTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val qsTileConfig = kosmos.qsNotesTileConfig private val mapper by lazy { diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileDataInteractorTest.kt index 4786fc40562a..84ab6905a007 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileDataInteractorTest.kt @@ -24,9 +24,9 @@ import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.toCollection @@ -38,12 +38,11 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class NotesTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val testUser = UserHandle.of(1) private lateinit var underTest: NotesTileDataInteractor - @EnableFlags(Flags.FLAG_NOTES_ROLE_QS_TILE) @Test fun availability_qsFlagEnabled_notesRoleEnabled_returnTrue() = @@ -92,7 +91,7 @@ class NotesTileDataInteractorTest : SysuiTestCase() { fun tileData_notEmpty() = runTest { underTest = NotesTileDataInteractor(isNoteTaskEnabled = true) val flowValue by - collectLastValue(underTest.tileData(testUser, flowOf(DataUpdateTrigger.InitialRequest))) + collectLastValue(underTest.tileData(testUser, flowOf(DataUpdateTrigger.InitialRequest))) runCurrent() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileUserActionInteractorTest.kt index 54911e612291..282af9159e2b 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/notes/domain/interactor/NotesTileUserActionInteractorTest.kt @@ -20,7 +20,6 @@ import android.content.Intent import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.notetask.NoteTaskController import com.android.systemui.notetask.NoteTaskEntryPoint @@ -29,18 +28,19 @@ import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandl import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandlerSubject import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx import com.android.systemui.qs.tiles.impl.notes.domain.model.NotesTileModel +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Test import org.junit.runner.RunWith -import org.mockito.kotlin.mock import org.mockito.Mockito.verify +import org.mockito.kotlin.mock @SmallTest @RunWith(AndroidJUnit4::class) class NotesTileUserActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val inputHandler = FakeQSTileIntentUserInputHandler() private val panelInteractor = mock<PanelInteractor>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/domain/interactor/OneHandedModeTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/domain/interactor/OneHandedModeTileDataInteractorTest.kt index 59eb069a5f3b..16b0caa78cfa 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/domain/interactor/OneHandedModeTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/domain/interactor/OneHandedModeTileDataInteractorTest.kt @@ -22,9 +22,9 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.accessibility.data.repository.oneHandedModeRepository import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger import com.android.systemui.qs.tiles.impl.onehanded.domain.OneHandedModeTileDataInteractor +import com.android.systemui.testKosmos import com.android.wm.shell.onehanded.OneHanded import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.flowOf @@ -37,7 +37,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class OneHandedModeTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testUser = UserHandle.of(1)!! private val oneHandedModeRepository = kosmos.oneHandedModeRepository private val underTest: OneHandedModeTileDataInteractor = diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/ui/OneHandedModeTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/ui/OneHandedModeTileMapperTest.kt index 5b39810e3477..3fba857bae1a 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/ui/OneHandedModeTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/onehanded/ui/OneHandedModeTileMapperTest.kt @@ -22,13 +22,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tileimpl.SubtitleArrayMapping import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.onehanded.domain.model.OneHandedModeTileModel import com.android.systemui.qs.tiles.impl.onehanded.qsOneHandedModeTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -36,7 +36,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class OneHandedModeTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val config = kosmos.qsOneHandedModeTileConfig private val subtitleArrayId = SubtitleArrayMapping.getSubtitleId(config.tileSpec.spec) private val subtitleArray by lazy { context.resources.getStringArray(subtitleArrayId) } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/domain/interactor/QRCodeScannerTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/domain/interactor/QRCodeScannerTileUserActionInteractorTest.kt index 312f18029570..ef21df6e2636 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/domain/interactor/QRCodeScannerTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/domain/interactor/QRCodeScannerTileUserActionInteractorTest.kt @@ -21,12 +21,12 @@ import android.platform.test.annotations.EnabledOnRavenwood import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandlerSubject import com.android.systemui.qs.tiles.base.actions.qsTileIntentUserInputHandler import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx import com.android.systemui.qs.tiles.impl.qr.domain.model.QRCodeScannerTileModel import com.android.systemui.qs.tiles.impl.qr.qrCodeScannerTileUserActionInteractor +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.mock import kotlinx.coroutines.test.runTest import org.junit.Test @@ -36,7 +36,7 @@ import org.junit.runner.RunWith @EnabledOnRavenwood @RunWith(AndroidJUnit4::class) class QRCodeScannerTileUserActionInteractorTest : SysuiTestCase() { - val kosmos = Kosmos() + val kosmos = testKosmos() private val inputHandler = kosmos.qsTileIntentUserInputHandler private val underTest = kosmos.qrCodeScannerTileUserActionInteractor private val intent = mock<Intent>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/ui/QRCodeScannerTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/ui/QRCodeScannerTileMapperTest.kt index c572ff60b61a..9e20aae6103e 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/ui/QRCodeScannerTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/qr/ui/QRCodeScannerTileMapperTest.kt @@ -23,11 +23,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.qr.domain.model.QRCodeScannerTileModel import com.android.systemui.qs.tiles.impl.qr.qsQRCodeScannerTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.mock import org.junit.Before import org.junit.Test @@ -36,7 +36,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class QRCodeScannerTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val config = kosmos.qsQRCodeScannerTileConfig private lateinit var mapper: QRCodeScannerTileMapper diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractorTest.kt index dc3248d42d62..fecb3deaaf36 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileDataInteractorTest.kt @@ -23,10 +23,10 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.accessibility.reduceBrightColorsController import com.android.systemui.coroutines.collectValues -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger import com.android.systemui.qs.tiles.impl.reducebrightness.domain.model.ReduceBrightColorsTileModel +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.runCurrent @@ -40,14 +40,14 @@ import org.junit.runner.RunWith class ReduceBrightColorsTileDataInteractorTest : SysuiTestCase() { private val isAvailable = true - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val reduceBrightColorsController = kosmos.reduceBrightColorsController private val underTest: ReduceBrightColorsTileDataInteractor = ReduceBrightColorsTileDataInteractor( testScope.testScheduler, isAvailable, - reduceBrightColorsController + reduceBrightColorsController, ) @Test diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt index 75b090c4034b..77321385b09e 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/domain/interactor/ReduceBrightColorsTileUserActionInteractorTest.kt @@ -28,11 +28,11 @@ import com.android.server.display.feature.flags.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.accessibility.extradim.ExtraDimDialogManager import com.android.systemui.accessibility.reduceBrightColorsController -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandler import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandlerSubject import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx import com.android.systemui.qs.tiles.impl.reducebrightness.domain.model.ReduceBrightColorsTileModel +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest import org.junit.Before @@ -48,7 +48,7 @@ import org.mockito.kotlin.verify @RunWith(AndroidJUnit4::class) class ReduceBrightColorsTileUserActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val inputHandler = FakeQSTileIntentUserInputHandler() private val controller = kosmos.reduceBrightColorsController diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/ui/ReduceBrightColorsTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/ui/ReduceBrightColorsTileMapperTest.kt index 00017f9059de..ebf70dad7149 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/ui/ReduceBrightColorsTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/reducebrightness/ui/ReduceBrightColorsTileMapperTest.kt @@ -23,12 +23,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.reducebrightness.domain.model.ReduceBrightColorsTileModel import com.android.systemui.qs.tiles.impl.reducebrightness.qsReduceBrightColorsTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -36,7 +36,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class ReduceBrightColorsTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val config = kosmos.qsReduceBrightColorsTileConfig private lateinit var mapper: ReduceBrightColorsTileMapper diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/domain/interactor/RotationLockTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/domain/interactor/RotationLockTileDataInteractorTest.kt index 283fa601f8df..6f05c3178754 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/domain/interactor/RotationLockTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/domain/interactor/RotationLockTileDataInteractorTest.kt @@ -28,9 +28,9 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.camera.data.repository.fakeCameraAutoRotateRepository import com.android.systemui.camera.data.repository.fakeCameraSensorPrivacyRepository import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.whenever import com.android.systemui.utils.leaks.FakeBatteryController @@ -48,7 +48,7 @@ import org.junit.runner.RunWith @EnabledOnRavenwood @RunWith(AndroidJUnit4::class) class RotationLockTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val batteryController = FakeBatteryController(LeakCheck()) private val rotationController = FakeRotationLockController(LeakCheck()) @@ -65,7 +65,7 @@ class RotationLockTileDataInteractorTest : SysuiTestCase() { whenever( packageManager.checkPermission( eq(Manifest.permission.CAMERA), - eq(TEST_PACKAGE_NAME) + eq(TEST_PACKAGE_NAME), ) ) .thenReturn(PackageManager.PERMISSION_GRANTED) @@ -81,7 +81,7 @@ class RotationLockTileDataInteractorTest : SysuiTestCase() { .apply { addOverride(com.android.internal.R.bool.config_allowRotationResolver, true) } - .resources + .resources, ) } @@ -182,7 +182,7 @@ class RotationLockTileDataInteractorTest : SysuiTestCase() { whenever( packageManager.checkPermission( eq(Manifest.permission.CAMERA), - eq(TEST_PACKAGE_NAME) + eq(TEST_PACKAGE_NAME), ) ) .thenReturn(PackageManager.PERMISSION_DENIED) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt index 74010143166b..0e6aaa6320c8 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt @@ -25,7 +25,6 @@ import com.android.systemui.common.shared.model.Icon import com.android.systemui.defaultDeviceState import com.android.systemui.deviceStateManager import com.android.systemui.foldedDeviceStateList -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.rotation.domain.model.RotationLockTileModel import com.android.systemui.qs.tiles.impl.rotation.qsRotationLockTileConfig @@ -33,6 +32,7 @@ import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R import com.android.systemui.statusbar.policy.DevicePostureController import com.android.systemui.statusbar.policy.devicePostureController +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import org.junit.Before import org.junit.Test @@ -42,7 +42,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class RotationLockTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val rotationLockTileConfig = kosmos.qsRotationLockTileConfig private val devicePostureController = kosmos.devicePostureController private val deviceStateManager = kosmos.deviceStateManager diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverTileMapperTest.kt index 1fb5048dd4c9..079921640705 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/saver/domain/DataSaverTileMapperTest.kt @@ -22,19 +22,19 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.saver.domain.model.DataSaverTileModel import com.android.systemui.qs.tiles.impl.saver.qsDataSaverTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class DataSaverTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val dataSaverTileConfig = kosmos.qsDataSaverTileConfig // Using lazy (versus =) to make sure we override the right context -- see b/311612168 diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileDataInteractorTest.kt index 41174e7ca6af..127160d8728d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileDataInteractorTest.kt @@ -22,11 +22,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger import com.android.systemui.screenrecord.data.model.ScreenRecordModel import com.android.systemui.screenrecord.data.repository.screenRecordRepository +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.runCurrent @@ -38,7 +38,7 @@ import org.junit.runner.RunWith @EnabledOnRavenwood @RunWith(AndroidJUnit4::class) class ScreenRecordTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val screenRecordRepo = kosmos.screenRecordRepository private val underTest: ScreenRecordTileDataInteractor = diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileUserActionInteractorTest.kt index 778c73fd8638..f47e0578461a 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/domain/interactor/ScreenRecordTileUserActionInteractorTest.kt @@ -26,7 +26,6 @@ import com.android.systemui.animation.DialogTransitionAnimator import com.android.systemui.animation.Expandable import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository import com.android.systemui.keyguard.domain.interactor.keyguardInteractor -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.mediaprojection.MediaProjectionMetricsLogger import com.android.systemui.plugins.ActivityStarter.OnDismissAction @@ -36,6 +35,7 @@ import com.android.systemui.screenrecord.RecordingController import com.android.systemui.screenrecord.data.model.ScreenRecordModel import com.android.systemui.screenrecord.data.repository.ScreenRecordRepositoryImpl import com.android.systemui.statusbar.phone.KeyguardDismissUtil +import com.android.systemui.testKosmos import kotlinx.coroutines.test.runTest import org.junit.Test import org.junit.runner.RunWith @@ -49,7 +49,7 @@ import org.mockito.kotlin.mock @SmallTest @RunWith(AndroidJUnit4::class) class ScreenRecordTileUserActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val keyguardInteractor = kosmos.keyguardInteractor private val dialogTransitionAnimator = mock<DialogTransitionAnimator>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/ui/ScreenRecordTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/ui/ScreenRecordTileMapperTest.kt index 363255695131..d118c096fd16 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/ui/ScreenRecordTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/screenrecord/ui/ScreenRecordTileMapperTest.kt @@ -23,13 +23,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.screenrecord.domain.ui.ScreenRecordTileMapper import com.android.systemui.qs.tiles.impl.screenrecord.qsScreenRecordTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R import com.android.systemui.screenrecord.data.model.ScreenRecordModel +import com.android.systemui.testKosmos import org.junit.Before import org.junit.Test import org.junit.runner.RunWith @@ -37,7 +37,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class ScreenRecordTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val config = kosmos.qsScreenRecordTileConfig private lateinit var mapper: ScreenRecordTileMapper diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileDataInteractorTest.kt index 6c7bb1b46c36..4a28fc02042d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileDataInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileDataInteractorTest.kt @@ -23,11 +23,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.qs.tiles.base.interactor.DataUpdateTrigger import com.android.systemui.qs.tiles.impl.sensorprivacy.SensorPrivacyToggleTileDataInteractor import com.android.systemui.statusbar.policy.IndividualSensorPrivacyController +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.argumentCaptor import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever @@ -44,7 +44,7 @@ import org.mockito.Mockito.verify @SmallTest @RunWith(AndroidJUnit4::class) class SensorPrivacyToggleTileDataInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val mockSensorPrivacyController = mock<IndividualSensorPrivacyController> { @@ -55,7 +55,7 @@ class SensorPrivacyToggleTileDataInteractorTest : SysuiTestCase() { SensorPrivacyToggleTileDataInteractor( testScope.testScheduler, mockSensorPrivacyController, - CAMERA + CAMERA, ) @Test diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileUserActionInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileUserActionInteractorTest.kt index 562e6ebcc029..7856fcaf4a1b 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileUserActionInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/domain/interactor/SensorPrivacyToggleTileUserActionInteractorTest.kt @@ -26,7 +26,6 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository import com.android.systemui.keyguard.domain.interactor.keyguardInteractor -import com.android.systemui.kosmos.Kosmos import com.android.systemui.plugins.activityStarter import com.android.systemui.qs.tiles.base.actions.FakeQSTileIntentUserInputHandler import com.android.systemui.qs.tiles.base.actions.QSTileIntentUserInputHandlerSubject @@ -34,6 +33,7 @@ import com.android.systemui.qs.tiles.base.interactor.QSTileInputTestKtx import com.android.systemui.qs.tiles.impl.sensorprivacy.domain.SensorPrivacyToggleTileUserActionInteractor import com.android.systemui.qs.tiles.impl.sensorprivacy.domain.model.SensorPrivacyToggleTileModel import com.android.systemui.statusbar.policy.IndividualSensorPrivacyController +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever @@ -48,7 +48,7 @@ import org.mockito.Mockito.verify @SmallTest @RunWith(AndroidJUnit4::class) class SensorPrivacyToggleTileUserActionInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val inputHandler = FakeQSTileIntentUserInputHandler() private val keyguardInteractor = kosmos.keyguardInteractor // The keyguard repository below is the same one kosmos used to create the interactor above @@ -64,7 +64,7 @@ class SensorPrivacyToggleTileUserActionInteractorTest : SysuiTestCase() { mockActivityStarter, mockSensorPrivacyController, fakeSafetyCenterManager, - CAMERA + CAMERA, ) @Test @@ -79,7 +79,7 @@ class SensorPrivacyToggleTileUserActionInteractorTest : SysuiTestCase() { .setSensorBlocked( eq(SensorPrivacyManager.Sources.QS_TILE), eq(CAMERA), - eq(!originalIsBlocked) + eq(!originalIsBlocked), ) } @@ -95,7 +95,7 @@ class SensorPrivacyToggleTileUserActionInteractorTest : SysuiTestCase() { .setSensorBlocked( eq(SensorPrivacyManager.Sources.QS_TILE), eq(CAMERA), - eq(!originalIsBlocked) + eq(!originalIsBlocked), ) } @@ -114,7 +114,7 @@ class SensorPrivacyToggleTileUserActionInteractorTest : SysuiTestCase() { .setSensorBlocked( eq(SensorPrivacyManager.Sources.QS_TILE), eq(CAMERA), - eq(!originalIsBlocked) + eq(!originalIsBlocked), ) verify(mockActivityStarter).postQSRunnableDismissingKeyguard(any()) } @@ -150,7 +150,7 @@ class SensorPrivacyToggleTileUserActionInteractorTest : SysuiTestCase() { mockActivityStarter, mockSensorPrivacyController, fakeSafetyCenterManager, - MICROPHONE + MICROPHONE, ) micUserActionInteractor.handleInput( diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/ui/SensorPrivacyToggleTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/ui/SensorPrivacyToggleTileMapperTest.kt index e4cd0e0ec215..3b810dc451f9 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/ui/SensorPrivacyToggleTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/sensorprivacy/ui/SensorPrivacyToggleTileMapperTest.kt @@ -24,7 +24,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.sensorprivacy.domain.model.SensorPrivacyToggleTileModel import com.android.systemui.qs.tiles.impl.sensorprivacy.qsCameraSensorPrivacyToggleTileConfig @@ -33,13 +32,14 @@ import com.android.systemui.qs.tiles.impl.sensorprivacy.ui.SensorPrivacyTileReso import com.android.systemui.qs.tiles.impl.sensorprivacy.ui.SensorPrivacyTileResources.MicrophonePrivacyTileResources import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import org.junit.Test import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class SensorPrivacyToggleTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val cameraConfig = kosmos.qsCameraSensorPrivacyToggleTileConfig private val micConfig = kosmos.qsMicrophoneSensorPrivacyToggleTileConfig diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/uimodenight/domain/UiModeNightTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/uimodenight/domain/UiModeNightTileMapperTest.kt index 8f5f2d3e6689..547bbbc895a6 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/uimodenight/domain/UiModeNightTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/uimodenight/domain/UiModeNightTileMapperTest.kt @@ -25,12 +25,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.uimodenight.UiModeNightTileModelHelper.createModel import com.android.systemui.qs.tiles.impl.uimodenight.qsUiModeNightTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import kotlin.reflect.KClass import org.junit.Test import org.junit.runner.RunWith @@ -38,7 +38,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class UiModeNightTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val qsTileConfig = kosmos.qsUiModeNightTileConfig private val mapper by lazy { diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/work/ui/WorkModeTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/work/ui/WorkModeTileMapperTest.kt index 2c81f39a03ec..ed3fc5058c44 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/work/ui/WorkModeTileMapperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/work/ui/WorkModeTileMapperTest.kt @@ -26,12 +26,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon -import com.android.systemui.kosmos.Kosmos import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject import com.android.systemui.qs.tiles.impl.work.domain.model.WorkModeTileModel import com.android.systemui.qs.tiles.impl.work.qsWorkModeTileConfig import com.android.systemui.qs.tiles.viewmodel.QSTileState import com.android.systemui.res.R +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.android.systemui.util.mockito.mock @@ -43,7 +43,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class WorkModeTileMapperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val qsTileConfig = kosmos.qsWorkModeTileConfig private val devicePolicyManager = kosmos.devicePolicyManager private val testLabel = context.getString(R.string.quick_settings_work_mode_label) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt index a8b005fb6554..12ed3f0c96fe 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt @@ -30,7 +30,6 @@ import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractorI import com.android.systemui.coroutines.collectLastValue import com.android.systemui.display.data.repository.displayStateRepository import com.android.systemui.dump.DumpManager -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope @@ -40,6 +39,7 @@ import com.android.systemui.qs.dagger.QSSceneComponent import com.android.systemui.settings.brightness.MirrorController import com.android.systemui.shade.data.repository.fakeShadeRepository import com.android.systemui.shade.domain.interactor.shadeModeInteractor +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.argumentCaptor import com.android.systemui.util.mockito.capture @@ -65,7 +65,7 @@ import org.mockito.Mockito.verify @RunWith(AndroidJUnit4::class) class QSSceneAdapterImplTest : SysuiTestCase() { - private val kosmos = Kosmos().apply { testCase = this@QSSceneAdapterImplTest } + private val kosmos = testKosmos().apply { testCase = this@QSSceneAdapterImplTest } private val testDispatcher = kosmos.testDispatcher private val testScope = kosmos.testScope diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingServiceSessionTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingServiceSessionTest.kt index 7bcaeabfee69..390a5d8efff1 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingServiceSessionTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingServiceSessionTest.kt @@ -28,12 +28,12 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.animation.DialogTransitionAnimator import com.android.systemui.animation.dialogTransitionAnimator import com.android.systemui.concurrency.fakeExecutor -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor import com.android.systemui.settings.UserContextProvider import com.android.systemui.settings.userFileManager import com.android.systemui.settings.userTracker +import com.android.systemui.testKosmos import com.android.systemui.util.settings.fakeGlobalSettings import com.android.traceur.TraceConfig import com.google.common.truth.Truth @@ -52,7 +52,7 @@ import org.mockito.kotlin.verify @TestableLooper.RunWithLooper(setAsMainLooper = true) class IssueRecordingServiceSessionTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val bgExecutor = kosmos.fakeExecutor private val userContextProvider: UserContextProvider = kosmos.userTracker private val dialogTransitionAnimator: DialogTransitionAnimator = kosmos.dialogTransitionAnimator diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingStateTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingStateTest.kt index 83bdcd2161ee..0510e6ca3ced 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingStateTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/IssueRecordingStateTest.kt @@ -22,9 +22,9 @@ import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.settings.userFileManager import com.android.systemui.settings.userTracker +import com.android.systemui.testKosmos import com.android.systemui.util.settings.fakeGlobalSettings import com.google.common.truth.Truth import org.junit.Before @@ -40,7 +40,7 @@ import org.mockito.kotlin.verify @TestableLooper.RunWithLooper(setAsMainLooper = true) class IssueRecordingStateTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private lateinit var underTest: IssueRecordingState @Mock private lateinit var resolver: ContentResolver diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/ScreenRecordingStartTimeStoreTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/ScreenRecordingStartTimeStoreTest.kt index 737b10166199..6f0dd16eacd4 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/ScreenRecordingStartTimeStoreTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/recordissue/ScreenRecordingStartTimeStoreTest.kt @@ -20,10 +20,10 @@ import android.testing.TestableLooper import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.settings.UserTracker import com.android.systemui.settings.userTracker +import com.android.systemui.testKosmos import com.google.common.truth.Truth import org.junit.Before import org.junit.Test @@ -34,7 +34,7 @@ import org.mockito.MockitoAnnotations @RunWith(AndroidJUnit4::class) @TestableLooper.RunWithLooper(setAsMainLooper = true) class ScreenRecordingStartTimeStoreTest : SysuiTestCase() { - private val userTracker: UserTracker = Kosmos().also { it.testCase = this }.userTracker + private val userTracker: UserTracker = testKosmos().also { it.testCase = this }.userTracker private lateinit var underTest: ScreenRecordingStartTimeStore diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractorTest.kt index a82a7de75cc0..7e9487b04862 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/WindowRootViewVisibilityInteractorTest.kt @@ -25,7 +25,6 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository import com.android.systemui.keyguard.shared.model.StatusBarState -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAsleepForTest import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAwakeForTest @@ -38,6 +37,7 @@ import com.android.systemui.statusbar.notification.domain.interactor.activeNotif import com.android.systemui.statusbar.notification.headsup.HeadsUpManager import com.android.systemui.statusbar.notification.init.NotificationsController import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor +import com.android.systemui.testKosmos import com.android.systemui.util.concurrency.FakeExecutor import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.argumentCaptor @@ -57,7 +57,7 @@ import org.mockito.Mockito.verify @RunWith(AndroidJUnit4::class) class WindowRootViewVisibilityInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val testDispatcher = StandardTestDispatcher() private val iStatusBarService = mock<IStatusBarService>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenrecord/data/repository/ScreenRecordRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenrecord/data/repository/ScreenRecordRepositoryTest.kt index 9724974e3044..bd5416676c8a 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenrecord/data/repository/ScreenRecordRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenrecord/data/repository/ScreenRecordRepositoryTest.kt @@ -21,10 +21,10 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.screenrecord.RecordingController import com.android.systemui.screenrecord.data.model.ScreenRecordModel +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest @@ -39,7 +39,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class ScreenRecordRepositoryTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val recordingController = mock<RecordingController>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerImplTest.kt index c6ce58185cf0..0c90d077273d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerImplTest.kt @@ -25,7 +25,6 @@ import com.android.internal.statusbar.IStatusBarService import com.android.systemui.SysuiTestCase import com.android.systemui.assist.AssistManager import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.log.LogBuffer import com.android.systemui.plugins.statusbar.StatusBarStateController @@ -43,6 +42,7 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController import com.android.systemui.statusbar.policy.KeyguardStateController import com.android.systemui.statusbar.window.StatusBarWindowController import com.android.systemui.statusbar.window.StatusBarWindowControllerStore +import com.android.systemui.testKosmos import com.android.systemui.util.concurrency.FakeExecutor import com.android.systemui.util.mockito.mock import com.android.systemui.util.mockito.whenever @@ -63,7 +63,7 @@ import org.mockito.MockitoAnnotations @SmallTest class ShadeControllerImplTest : SysuiTestCase() { private val executor = FakeExecutor(FakeSystemClock()) - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope @Mock private lateinit var commandQueue: CommandQueue diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerSceneImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerSceneImplTest.kt index 054c1b8207eb..32eec56af8ea 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerSceneImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/ShadeControllerSceneImplTest.kt @@ -27,7 +27,6 @@ import com.android.systemui.flags.Flags import com.android.systemui.flags.fakeFeatureFlagsClassic import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFingerprintAuthRepository import com.android.systemui.keyguard.shared.model.SuccessFingerprintAuthenticationStatus -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.scene.domain.interactor.sceneInteractor @@ -35,6 +34,7 @@ import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.shade.domain.interactor.shadeInteractor import com.android.systemui.statusbar.CommandQueue +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.mock import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.MutableStateFlow @@ -52,7 +52,7 @@ import org.mockito.Mockito.verify @RunWith(AndroidJUnit4::class) @EnableSceneContainer class ShadeControllerSceneImplTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope private val sceneInteractor by lazy { kosmos.sceneInteractor } private val deviceEntryInteractor by lazy { kosmos.deviceEntryInteractor } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/OperatorNameViewControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/OperatorNameViewControllerTest.kt index 03dee3aeb75c..72d21f1064af 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/OperatorNameViewControllerTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/OperatorNameViewControllerTest.kt @@ -24,13 +24,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.keyguard.keyguardUpdateMonitor import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.plugins.DarkIconDispatcher import com.android.systemui.statusbar.pipeline.airplane.data.repository.FakeAirplaneModeRepository import com.android.systemui.statusbar.pipeline.airplane.domain.interactor.AirplaneModeInteractor import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository import com.android.systemui.statusbar.pipeline.mobile.util.FakeSubscriptionManagerProxy import com.android.systemui.statusbar.pipeline.shared.data.repository.FakeConnectivityRepository +import com.android.systemui.testKosmos import com.android.systemui.tuner.TunerService import com.android.systemui.util.CarrierConfigTracker import com.android.systemui.util.kotlin.JavaAdapter @@ -54,7 +54,7 @@ class OperatorNameViewControllerTest : SysuiTestCase() { private lateinit var underTest: OperatorNameViewController private lateinit var airplaneModeInteractor: AirplaneModeInteractor - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = TestScope() private val view = OperatorNameView(mContext) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/domian/interactor/MediaRouterChipInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/domian/interactor/MediaRouterChipInteractorTest.kt index b2174c1b1d8c..21a4560dafee 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/domian/interactor/MediaRouterChipInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/domian/interactor/MediaRouterChipInteractorTest.kt @@ -20,12 +20,12 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.mediarouter.data.repository.fakeMediaRouterRepository import com.android.systemui.statusbar.chips.casttootherdevice.domain.interactor.mediaRouterChipInteractor import com.android.systemui.statusbar.chips.casttootherdevice.domain.model.MediaRouterCastModel import com.android.systemui.statusbar.policy.CastDevice +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import kotlinx.coroutines.test.runCurrent @@ -35,7 +35,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class MediaRouterChipInteractorTest : SysuiTestCase() { - val kosmos = Kosmos() + val kosmos = testKosmos() val testScope = kosmos.testScope val mediaRouterRepository = kosmos.fakeMediaRouterRepository diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndCastScreenToOtherDeviceDialogDelegateTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndCastScreenToOtherDeviceDialogDelegateTest.kt index 274efbb50788..568129706458 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndCastScreenToOtherDeviceDialogDelegateTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndCastScreenToOtherDeviceDialogDelegateTest.kt @@ -30,7 +30,6 @@ import android.view.Window import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.mediaprojection.data.model.MediaProjectionState @@ -41,6 +40,7 @@ import com.android.systemui.statusbar.chips.mediaprojection.domain.interactor.me import com.android.systemui.statusbar.chips.mediaprojection.domain.model.ProjectionChipModel import com.android.systemui.statusbar.chips.mediaprojection.ui.view.endMediaProjectionDialogHelper import com.android.systemui.statusbar.phone.SystemUIDialog +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import kotlinx.coroutines.test.runCurrent @@ -57,7 +57,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class EndCastScreenToOtherDeviceDialogDelegateTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val sysuiDialog = mock<SystemUIDialog>() private lateinit var underTest: EndCastScreenToOtherDeviceDialogDelegate diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndGenericCastToOtherDeviceDialogDelegateTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndGenericCastToOtherDeviceDialogDelegateTest.kt index 88207d1c61d8..30a415cb9906 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndGenericCastToOtherDeviceDialogDelegateTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/view/EndGenericCastToOtherDeviceDialogDelegateTest.kt @@ -26,7 +26,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.mediarouter.data.repository.fakeMediaRouterRepository @@ -35,6 +34,7 @@ import com.android.systemui.statusbar.chips.casttootherdevice.domain.interactor. import com.android.systemui.statusbar.chips.mediaprojection.ui.view.endMediaProjectionDialogHelper import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.statusbar.policy.CastDevice +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import kotlinx.coroutines.test.runCurrent @@ -51,7 +51,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class EndGenericCastToOtherDeviceDialogDelegateTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val sysuiDialog = mock<SystemUIDialog>() private lateinit var underTest: EndGenericCastToOtherDeviceDialogDelegate diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/viewmodel/CastToOtherDeviceChipViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/viewmodel/CastToOtherDeviceChipViewModelTest.kt index ccc844ad5837..d921ab3b284d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/viewmodel/CastToOtherDeviceChipViewModelTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/casttootherdevice/ui/viewmodel/CastToOtherDeviceChipViewModelTest.kt @@ -30,7 +30,6 @@ import com.android.systemui.animation.mockDialogTransitionAnimator import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.mediaprojection.data.model.MediaProjectionState @@ -52,6 +51,7 @@ import com.android.systemui.statusbar.phone.mockSystemUIDialogFactory import com.android.systemui.statusbar.phone.ongoingcall.DisableChipsModernization import com.android.systemui.statusbar.phone.ongoingcall.EnableChipsModernization import com.android.systemui.statusbar.policy.CastDevice +import com.android.systemui.testKosmos import com.android.systemui.util.time.fakeSystemClock import com.google.common.truth.Truth.assertThat import kotlin.test.Test @@ -69,7 +69,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class CastToOtherDeviceChipViewModelTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val testScope = kosmos.testScope private val mediaProjectionRepo = kosmos.fakeMediaProjectionRepository private val mediaRouterRepo = kosmos.fakeMediaRouterRepository diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/mediaprojection/ui/view/EndMediaProjectionDialogHelperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/mediaprojection/ui/view/EndMediaProjectionDialogHelperTest.kt index 795988f0087f..fac50b38d838 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/mediaprojection/ui/view/EndMediaProjectionDialogHelperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/mediaprojection/ui/view/EndMediaProjectionDialogHelperTest.kt @@ -24,12 +24,12 @@ import android.content.pm.PackageManager import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.mediaprojection.data.model.MediaProjectionState import com.android.systemui.mediaprojection.taskswitcher.FakeActivityTaskManager.Companion.createTask import com.android.systemui.statusbar.phone.SystemUIDialog import com.android.systemui.statusbar.phone.mockSystemUIDialogFactory +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import org.junit.runner.RunWith @@ -42,7 +42,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class EndMediaProjectionDialogHelperTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val underTest = kosmos.endMediaProjectionDialogHelper diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/screenrecord/ui/view/EndScreenRecordingDialogDelegateTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/screenrecord/ui/view/EndScreenRecordingDialogDelegateTest.kt index f560ee7730ae..981c9525f636 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/screenrecord/ui/view/EndScreenRecordingDialogDelegateTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/screenrecord/ui/view/EndScreenRecordingDialogDelegateTest.kt @@ -30,7 +30,6 @@ import android.view.Window import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.mediaprojection.taskswitcher.FakeActivityTaskManager.Companion.createTask @@ -39,6 +38,7 @@ import com.android.systemui.screenrecord.data.repository.screenRecordRepository import com.android.systemui.statusbar.chips.mediaprojection.ui.view.endMediaProjectionDialogHelper import com.android.systemui.statusbar.chips.screenrecord.domain.interactor.screenRecordChipInteractor import com.android.systemui.statusbar.phone.SystemUIDialog +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import kotlinx.coroutines.test.runCurrent @@ -55,7 +55,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class EndScreenRecordingDialogDelegateTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val sysuiDialog = mock<SystemUIDialog>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/sharetoapp/ui/view/EndShareScreenToAppDialogDelegateTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/sharetoapp/ui/view/EndShareScreenToAppDialogDelegateTest.kt index 95aa6cd3250b..b2e90ecbeef1 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/sharetoapp/ui/view/EndShareScreenToAppDialogDelegateTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/sharetoapp/ui/view/EndShareScreenToAppDialogDelegateTest.kt @@ -30,7 +30,6 @@ import android.view.Window import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.kosmos.testScope import com.android.systemui.mediaprojection.data.model.MediaProjectionState @@ -41,6 +40,7 @@ import com.android.systemui.statusbar.chips.mediaprojection.domain.interactor.me import com.android.systemui.statusbar.chips.mediaprojection.domain.model.ProjectionChipModel import com.android.systemui.statusbar.chips.mediaprojection.ui.view.endMediaProjectionDialogHelper import com.android.systemui.statusbar.phone.SystemUIDialog +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import kotlinx.coroutines.test.runCurrent @@ -57,7 +57,7 @@ import org.mockito.kotlin.whenever @SmallTest @RunWith(AndroidJUnit4::class) class EndShareScreenToAppDialogDelegateTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private val sysuiDialog = mock<SystemUIDialog>() private lateinit var underTest: EndShareScreenToAppDialogDelegate diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/ChipTransitionHelperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/ChipTransitionHelperTest.kt index e3a84fd2c2eb..6d91fb5a10cb 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/ChipTransitionHelperTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/chips/ui/viewmodel/ChipTransitionHelperTest.kt @@ -22,12 +22,12 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.common.shared.model.Icon import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.applicationCoroutineScope import com.android.systemui.kosmos.testScope import com.android.systemui.res.R import com.android.systemui.statusbar.chips.ui.model.ColorsModel import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlin.test.Test import kotlinx.coroutines.flow.MutableStateFlow @@ -39,7 +39,7 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class ChipTransitionHelperTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = kosmos.testScope @Test diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt index 2f6bedb42e45..ea61b715475d 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt @@ -29,7 +29,6 @@ import com.android.internal.statusbar.LetterboxDetails import com.android.internal.view.AppearanceRegion import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.statusbar.CommandQueue import com.android.systemui.statusbar.data.model.StatusBarMode import com.android.systemui.statusbar.layout.BoundsPair @@ -42,6 +41,7 @@ import com.android.systemui.statusbar.phone.ongoingcall.EnableChipsModernization import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingCallRepository import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel import com.android.systemui.statusbar.phone.ongoingcall.shared.model.inCallModel +import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.argumentCaptor import com.android.systemui.util.mockito.capture @@ -59,7 +59,7 @@ import org.mockito.Mockito.verify @SmallTest @RunWith(AndroidJUnit4::class) class StatusBarModeRepositoryImplTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope = TestScope() private val commandQueue = mock<CommandQueue>() private val letterboxAppearanceCalculator = mock<LetterboxAppearanceCalculator>() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.kt index b5f3269903b8..0ac5fe95957c 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.kt @@ -58,7 +58,6 @@ import com.android.internal.logging.metricsLogger import com.android.internal.logging.uiEventLoggerFake import com.android.systemui.Dependency import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.res.R import com.android.systemui.statusbar.RankingBuilder @@ -70,6 +69,7 @@ import com.android.systemui.statusbar.notification.row.icon.AppIconProvider import com.android.systemui.statusbar.notification.row.icon.NotificationIconStyleProvider import com.android.systemui.statusbar.notification.row.icon.appIconProvider import com.android.systemui.statusbar.notification.row.icon.notificationIconStyleProvider +import com.android.systemui.testKosmos import com.android.telecom.telecomManager import com.google.common.truth.Truth.assertThat import java.util.concurrent.CountDownLatch @@ -91,7 +91,7 @@ import org.mockito.kotlin.whenever @RunWith(AndroidJUnit4::class) @RunWithLooper class NotificationInfoTest : SysuiTestCase() { - private val kosmos = Kosmos().also { it.testCase = this } + private val kosmos = testKosmos().also { it.testCase = this } private lateinit var underTest: NotificationInfo private lateinit var notificationChannel: NotificationChannel diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt index 048028cdc0fa..db0c59f6d602 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt @@ -23,12 +23,12 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFaceAuthRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testCase import com.android.systemui.plugins.statusbar.statusBarStateController import com.android.systemui.power.data.repository.fakePowerRepository import com.android.systemui.statusbar.lockscreenShadeTransitionController import com.android.systemui.statusbar.phone.screenOffAnimationController +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest import org.junit.Test @@ -44,7 +44,7 @@ import org.mockito.kotlin.whenever class NotificationShelfInteractorTest : SysuiTestCase() { private val kosmos = - Kosmos().apply { + testKosmos().apply { testCase = this@NotificationShelfInteractorTest lockscreenShadeTransitionController = mock() screenOffAnimationController = mock() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt index 6381b4e0fef7..7265262183ca 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt @@ -24,7 +24,6 @@ import com.android.systemui.coroutines.collectLastValue import com.android.systemui.flags.EnableSceneContainer import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFaceAuthRepository import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.collectLastValue import com.android.systemui.kosmos.runTest import com.android.systemui.kosmos.testCase @@ -35,6 +34,7 @@ import com.android.systemui.shade.domain.interactor.enableSingleShade import com.android.systemui.shade.domain.interactor.enableSplitShade import com.android.systemui.statusbar.lockscreenShadeTransitionController import com.android.systemui.statusbar.phone.screenOffAnimationController +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest import org.junit.Test @@ -50,7 +50,7 @@ import org.mockito.kotlin.whenever class NotificationShelfViewModelTest : SysuiTestCase() { private val kosmos = - Kosmos().apply { + testKosmos().apply { testCase = this@NotificationShelfViewModelTest lockscreenShadeTransitionController = mock() screenOffAnimationController = mock() diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt index eb95ddb39b40..c58b4bc9953c 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/OngoingCallControllerTest.kt @@ -30,7 +30,6 @@ import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.concurrency.fakeExecutor import com.android.systemui.dump.DumpManager -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope import com.android.systemui.log.logcatLogBuffer import com.android.systemui.res.R @@ -48,6 +47,7 @@ import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingC import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel import com.android.systemui.statusbar.window.StatusBarWindowController import com.android.systemui.statusbar.window.StatusBarWindowControllerStore +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest @@ -70,7 +70,7 @@ import org.mockito.kotlin.whenever @TestableLooper.RunWithLooper @DisableFlags(StatusBarChipsModernization.FLAG_NAME) class OngoingCallControllerTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val mainExecutor = kosmos.fakeExecutor private val testScope = kosmos.testScope diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/data/repository/OngoingCallRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/data/repository/OngoingCallRepositoryTest.kt index a44631348796..7de56ddc06c3 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/data/repository/OngoingCallRepositoryTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/data/repository/OngoingCallRepositoryTest.kt @@ -19,12 +19,11 @@ package com.android.systemui.statusbar.phone.ongoingcall.data.repository import android.platform.test.annotations.DisableFlags import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest -import com.android.systemui.Flags.FLAG_STATUS_BAR_CHIPS_MODERNIZATION import com.android.systemui.SysuiTestCase -import com.android.systemui.kosmos.Kosmos import com.android.systemui.statusbar.phone.ongoingcall.StatusBarChipsModernization import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel import com.android.systemui.statusbar.phone.ongoingcall.shared.model.inCallModel +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import org.junit.Test import org.junit.runner.RunWith @@ -33,7 +32,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @DisableFlags(StatusBarChipsModernization.FLAG_NAME) class OngoingCallRepositoryTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val underTest = kosmos.ongoingCallRepository @Test diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractorTest.kt index f4204af7829b..84f1d5cd4895 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/ongoingcall/domain/interactor/OngoingCallInteractorTest.kt @@ -23,7 +23,6 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.activity.data.repository.activityManagerRepository import com.android.systemui.activity.data.repository.fake import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.collectLastValue import com.android.systemui.kosmos.runTest import com.android.systemui.kosmos.useUnconfinedTestDispatcher @@ -36,6 +35,7 @@ import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCall import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallTestHelper.addOngoingCallState import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallTestHelper.removeOngoingCallState import com.android.systemui.statusbar.window.fakeStatusBarWindowControllerStore +import com.android.systemui.testKosmos import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest import org.junit.Before @@ -51,7 +51,7 @@ import org.mockito.kotlin.verify @RunWith(AndroidJUnit4::class) @EnableChipsModernization class OngoingCallInteractorTest : SysuiTestCase() { - private val kosmos = Kosmos().useUnconfinedTestDispatcher() + private val kosmos = testKosmos().useUnconfinedTestDispatcher() private val underTest = kosmos.ongoingCallInteractor @Before diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt index 92bec70d2c4d..18a124cf362e 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt @@ -38,7 +38,6 @@ import com.android.systemui.display.data.repository.DeviceStateRepository.Device import com.android.systemui.display.data.repository.fakeDeviceStateRepository import com.android.systemui.foldedDeviceStateList import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor -import com.android.systemui.kosmos.Kosmos import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAsleepForTest import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAwakeForTest import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setScreenPowerState @@ -47,6 +46,7 @@ import com.android.systemui.power.shared.model.ScreenPowerState.SCREEN_OFF import com.android.systemui.power.shared.model.ScreenPowerState.SCREEN_ON import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.statusbar.policy.FakeConfigurationController +import com.android.systemui.testKosmos import com.android.systemui.unfold.DisplaySwitchLatencyTracker.Companion.COOL_DOWN_DURATION import com.android.systemui.unfold.DisplaySwitchLatencyTracker.Companion.FOLDABLE_DEVICE_STATE_CLOSED import com.android.systemui.unfold.DisplaySwitchLatencyTracker.Companion.FOLDABLE_DEVICE_STATE_HALF_OPEN @@ -89,7 +89,7 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() { private lateinit var displaySwitchLatencyTracker: DisplaySwitchLatencyTracker @Captor private lateinit var loggerArgumentCaptor: ArgumentCaptor<DisplaySwitchLatencyEvent> - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val mockContext = mock<Context>() private val resources = mock<Resources>() private val foldStateRepository = kosmos.fakeDeviceStateRepository diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/FoldLightRevealOverlayAnimationTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/FoldLightRevealOverlayAnimationTest.kt index dfc4d0f07df8..98d99f781879 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/FoldLightRevealOverlayAnimationTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/FoldLightRevealOverlayAnimationTest.kt @@ -28,7 +28,6 @@ import com.android.systemui.SysuiTestCase import com.android.systemui.animation.AnimatorTestRule import com.android.systemui.display.data.repository.DeviceStateRepository.DeviceState import com.android.systemui.display.data.repository.fakeDeviceStateRepository -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testDispatcher import com.android.systemui.kosmos.testScope import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAsleepForTest @@ -36,6 +35,7 @@ import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.se import com.android.systemui.power.domain.interactor.powerInteractor import com.android.systemui.power.shared.model.ScreenPowerState import com.android.systemui.statusbar.LightRevealScrim +import com.android.systemui.testKosmos import com.android.systemui.util.animation.data.repository.fakeAnimationStatusRepository import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.advanceTimeBy @@ -61,7 +61,7 @@ import org.mockito.kotlin.whenever class FoldLightRevealOverlayAnimationTest : SysuiTestCase() { @get:Rule val animatorTestRule = AnimatorTestRule(this) - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val testScope: TestScope = kosmos.testScope private val fakeDeviceStateRepository = kosmos.fakeDeviceStateRepository private val powerInteractor = kosmos.powerInteractor @@ -93,7 +93,7 @@ class FoldLightRevealOverlayAnimationTest : SysuiTestCase() { fakeAnimationStatusRepository, mockControllerFactory, mockFoldLockSettingAvailabilityProvider, - mockJankMonitor + mockJankMonitor, ) foldLightRevealAnimation.init() } diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt index b4ba41a5c524..a180d51ff0ba 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt @@ -27,7 +27,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.deviceStateManager -import com.android.systemui.kosmos.Kosmos +import com.android.systemui.testKosmos import junit.framework.Assert.assertFalse import junit.framework.Assert.assertTrue import org.junit.Before @@ -39,7 +39,7 @@ import org.mockito.kotlin.whenever @RunWith(AndroidJUnit4::class) class UtilsTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private val deviceStateManager = kosmos.deviceStateManager private lateinit var testableResources: TestableResources @@ -53,7 +53,7 @@ class UtilsTest : SysuiTestCase() { fun isFoldableReturnsFalse_overlayConfigurationValues() { testableResources.addOverride( com.android.internal.R.array.config_foldedDeviceStates, - intArrayOf() // empty array <=> device is not foldable + intArrayOf(), // empty array <=> device is not foldable ) whenever(deviceStateManager.supportedDeviceStates).thenReturn(listOf(DEFAULT_DEVICE_STATE)) assertFalse(Utils.isDeviceFoldable(testableResources.resources, deviceStateManager)) @@ -64,7 +64,7 @@ class UtilsTest : SysuiTestCase() { fun isFoldableReturnsFalse_deviceStateManager() { testableResources.addOverride( com.android.internal.R.array.config_foldedDeviceStates, - intArrayOf() // empty array <=> device is not foldable + intArrayOf(), // empty array <=> device is not foldable ) whenever(deviceStateManager.supportedDeviceStates).thenReturn(listOf(DEFAULT_DEVICE_STATE)) assertFalse(Utils.isDeviceFoldable(testableResources.resources, deviceStateManager)) @@ -75,7 +75,7 @@ class UtilsTest : SysuiTestCase() { fun isFoldableReturnsTrue_overlayConfigurationValues() { testableResources.addOverride( com.android.internal.R.array.config_foldedDeviceStates, - intArrayOf(FOLDED_DEVICE_STATE.identifier) + intArrayOf(FOLDED_DEVICE_STATE.identifier), ) whenever(deviceStateManager.supportedDeviceStates) .thenReturn(listOf(FOLDED_DEVICE_STATE, UNFOLDED_DEVICE_STATE)) @@ -87,7 +87,7 @@ class UtilsTest : SysuiTestCase() { fun isFoldableReturnsTrue_deviceStateManager() { testableResources.addOverride( com.android.internal.R.array.config_foldedDeviceStates, - intArrayOf(FOLDED_DEVICE_STATE.identifier) + intArrayOf(FOLDED_DEVICE_STATE.identifier), ) whenever(deviceStateManager.supportedDeviceStates) .thenReturn(listOf(FOLDED_DEVICE_STATE, UNFOLDED_DEVICE_STATE)) diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/domain/interactor/ComponentsInteractorImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/domain/interactor/ComponentsInteractorImplTest.kt index f232d52615a4..93e5721e9b27 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/domain/interactor/ComponentsInteractorImplTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/domain/interactor/ComponentsInteractorImplTest.kt @@ -20,8 +20,8 @@ import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.coroutines.collectLastValue -import com.android.systemui.kosmos.Kosmos import com.android.systemui.kosmos.testScope +import com.android.systemui.testKosmos import com.android.systemui.volume.panel.domain.availableCriteria import com.android.systemui.volume.panel.domain.defaultCriteria import com.android.systemui.volume.panel.domain.model.ComponentModel @@ -39,7 +39,7 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class ComponentsInteractorImplTest : SysuiTestCase() { - private val kosmos = Kosmos() + private val kosmos = testKosmos() private lateinit var underTest: ComponentsInteractor @@ -60,12 +60,7 @@ class ComponentsInteractorImplTest : SysuiTestCase() { fun componentsAvailability_checked() { with(kosmos) { testScope.runTest { - enabledComponents = - setOf( - BOTTOM_BAR, - COMPONENT_1, - COMPONENT_2, - ) + enabledComponents = setOf(BOTTOM_BAR, COMPONENT_1, COMPONENT_2) criteriaByKey = mapOf( BOTTOM_BAR to Provider { availableCriteria }, @@ -90,12 +85,7 @@ class ComponentsInteractorImplTest : SysuiTestCase() { fun noCriteria_fallbackToDefaultCriteria() { with(kosmos) { testScope.runTest { - enabledComponents = - setOf( - BOTTOM_BAR, - COMPONENT_1, - COMPONENT_2, - ) + enabledComponents = setOf(BOTTOM_BAR, COMPONENT_1, COMPONENT_2) criteriaByKey = mapOf( BOTTOM_BAR to Provider { availableCriteria }, |