Loading packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt +9 −4 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.shared.model.fakeSceneDataSource import com.android.systemui.scene.shared.model.fakeSceneDataSource import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel import com.android.systemui.shade.domain.interactor.enableSingleShade import com.android.systemui.shade.ui.viewmodel.shadeSceneContentViewModel import com.android.systemui.shade.ui.viewmodel.shadeSceneContentViewModel import com.android.systemui.shade.ui.viewmodel.shadeUserActionsViewModel import com.android.systemui.shade.ui.viewmodel.shadeUserActionsViewModel import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository Loading @@ -68,6 +69,7 @@ import com.android.systemui.util.settings.data.repository.userAwareSecureSetting import com.android.telecom.mockTelecomManager import com.android.telecom.mockTelecomManager import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage import com.google.common.truth.Truth.assertWithMessage import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.Job import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.flowOf Loading Loading @@ -95,11 +97,13 @@ import org.junit.runner.RunWith * being used when the state is as required (e.g. cannot unlock an already unlocked device, cannot * being used when the state is as required (e.g. cannot unlock an already unlocked device, cannot * put to sleep a device that's already asleep, etc.). * put to sleep a device that's already asleep, etc.). */ */ @OptIn(ExperimentalCoroutinesApi::class) @SmallTest @SmallTest @RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class) @RunWithLooper @RunWithLooper @EnableSceneContainer @EnableSceneContainer class SceneFrameworkIntegrationTest : SysuiTestCase() { class SceneFrameworkIntegrationTest : SysuiTestCase() { private val kosmos = testKosmos() private val kosmos = testKosmos() private var bouncerOverlayJob: Job? = null private var bouncerOverlayJob: Job? = null Loading Loading @@ -179,6 +183,7 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { @Test @Test fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenNotDismissed_goesToLockscreen() = fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenNotDismissed_goesToLockscreen() = kosmos.runTest { kosmos.runTest { enableSingleShade() val actions by collectLastValue(shadeUserActionsViewModel.actions) val actions by collectLastValue(shadeUserActionsViewModel.actions) setAuthMethod(AuthenticationMethodModel.None, enableLockscreen = true) setAuthMethod(AuthenticationMethodModel.None, enableLockscreen = true) assertCurrentScene(Scenes.Lockscreen) assertCurrentScene(Scenes.Lockscreen) Loading @@ -196,6 +201,7 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { @Test @Test fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenDismissed_goesToGone() = fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenDismissed_goesToGone() = kosmos.runTest { kosmos.runTest { enableSingleShade() val actions by collectLastValue(shadeUserActionsViewModel.actions) val actions by collectLastValue(shadeUserActionsViewModel.actions) val canSwipeToEnter by collectLastValue(deviceEntryInteractor.canSwipeToEnter) val canSwipeToEnter by collectLastValue(deviceEntryInteractor.canSwipeToEnter) Loading Loading @@ -711,7 +717,7 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { powerInteractor.setAsleepForTest() powerInteractor.setAsleepForTest() if (waitForLock) { if (waitForLock) { testScope.advanceTimeBy( testScope.advanceTimeBy( kosmos.userAwareSecureSettingsRepository userAwareSecureSettingsRepository .getInt( .getInt( Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, KeyguardViewMediator.KEYGUARD_LOCK_AFTER_DELAY_DEFAULT, KeyguardViewMediator.KEYGUARD_LOCK_AFTER_DELAY_DEFAULT, Loading @@ -723,9 +729,8 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { /** Emulates the dismissal of the IME (soft keyboard). */ /** Emulates the dismissal of the IME (soft keyboard). */ private fun Kosmos.dismissIme() { private fun Kosmos.dismissIme() { (currentValue(bouncerOverlayContentViewModel.authMethodViewModel) val authViewModel = bouncerOverlayContentViewModel.authMethodViewModel as? PasswordBouncerViewModel) (currentValue(authViewModel) as? PasswordBouncerViewModel)?.onImeDismissed() ?.let { it.onImeDismissed() } } } private fun Kosmos.introduceLockedSim() { private fun Kosmos.introduceLockedSim() { Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/scene/SceneFrameworkIntegrationTest.kt +9 −4 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,7 @@ import com.android.systemui.scene.shared.model.Overlays import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.scene.shared.model.fakeSceneDataSource import com.android.systemui.scene.shared.model.fakeSceneDataSource import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel import com.android.systemui.scene.ui.viewmodel.SceneContainerViewModel import com.android.systemui.shade.domain.interactor.enableSingleShade import com.android.systemui.shade.ui.viewmodel.shadeSceneContentViewModel import com.android.systemui.shade.ui.viewmodel.shadeSceneContentViewModel import com.android.systemui.shade.ui.viewmodel.shadeUserActionsViewModel import com.android.systemui.shade.ui.viewmodel.shadeUserActionsViewModel import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository Loading @@ -68,6 +69,7 @@ import com.android.systemui.util.settings.data.repository.userAwareSecureSetting import com.android.telecom.mockTelecomManager import com.android.telecom.mockTelecomManager import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertThat import com.google.common.truth.Truth.assertWithMessage import com.google.common.truth.Truth.assertWithMessage import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.Job import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.flow.flowOf Loading Loading @@ -95,11 +97,13 @@ import org.junit.runner.RunWith * being used when the state is as required (e.g. cannot unlock an already unlocked device, cannot * being used when the state is as required (e.g. cannot unlock an already unlocked device, cannot * put to sleep a device that's already asleep, etc.). * put to sleep a device that's already asleep, etc.). */ */ @OptIn(ExperimentalCoroutinesApi::class) @SmallTest @SmallTest @RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class) @RunWithLooper @RunWithLooper @EnableSceneContainer @EnableSceneContainer class SceneFrameworkIntegrationTest : SysuiTestCase() { class SceneFrameworkIntegrationTest : SysuiTestCase() { private val kosmos = testKosmos() private val kosmos = testKosmos() private var bouncerOverlayJob: Job? = null private var bouncerOverlayJob: Job? = null Loading Loading @@ -179,6 +183,7 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { @Test @Test fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenNotDismissed_goesToLockscreen() = fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenNotDismissed_goesToLockscreen() = kosmos.runTest { kosmos.runTest { enableSingleShade() val actions by collectLastValue(shadeUserActionsViewModel.actions) val actions by collectLastValue(shadeUserActionsViewModel.actions) setAuthMethod(AuthenticationMethodModel.None, enableLockscreen = true) setAuthMethod(AuthenticationMethodModel.None, enableLockscreen = true) assertCurrentScene(Scenes.Lockscreen) assertCurrentScene(Scenes.Lockscreen) Loading @@ -196,6 +201,7 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { @Test @Test fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenDismissed_goesToGone() = fun swipeUpOnShadeScene_withAuthMethodSwipe_lockscreenDismissed_goesToGone() = kosmos.runTest { kosmos.runTest { enableSingleShade() val actions by collectLastValue(shadeUserActionsViewModel.actions) val actions by collectLastValue(shadeUserActionsViewModel.actions) val canSwipeToEnter by collectLastValue(deviceEntryInteractor.canSwipeToEnter) val canSwipeToEnter by collectLastValue(deviceEntryInteractor.canSwipeToEnter) Loading Loading @@ -711,7 +717,7 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { powerInteractor.setAsleepForTest() powerInteractor.setAsleepForTest() if (waitForLock) { if (waitForLock) { testScope.advanceTimeBy( testScope.advanceTimeBy( kosmos.userAwareSecureSettingsRepository userAwareSecureSettingsRepository .getInt( .getInt( Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, KeyguardViewMediator.KEYGUARD_LOCK_AFTER_DELAY_DEFAULT, KeyguardViewMediator.KEYGUARD_LOCK_AFTER_DELAY_DEFAULT, Loading @@ -723,9 +729,8 @@ class SceneFrameworkIntegrationTest : SysuiTestCase() { /** Emulates the dismissal of the IME (soft keyboard). */ /** Emulates the dismissal of the IME (soft keyboard). */ private fun Kosmos.dismissIme() { private fun Kosmos.dismissIme() { (currentValue(bouncerOverlayContentViewModel.authMethodViewModel) val authViewModel = bouncerOverlayContentViewModel.authMethodViewModel as? PasswordBouncerViewModel) (currentValue(authViewModel) as? PasswordBouncerViewModel)?.onImeDismissed() ?.let { it.onImeDismissed() } } } private fun Kosmos.introduceLockedSim() { private fun Kosmos.introduceLockedSim() { Loading