Loading packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/domain/interactor/WallpaperFocalAreaInteractorTest.kt +51 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,57 @@ class WallpaperFocalAreaInteractorTest : SysuiTestCase() { assertThat(shouldCollectFocalArea).isFalse() } @Test @DisableSceneContainer fun shouldCollectFocalArea_whenTransitioningToLockscreen_sceneContainerDisabled() = testScope.runTest { val shouldCollectFocalArea by collectLastValue(underTest.shouldCollectFocalArea) // Initially true due to onStart assertThat(shouldCollectFocalArea).isTrue() // Transition away from lockscreen, should stop collecting kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( from = LOCKSCREEN, to = GONE, transitionState = TransitionState.STARTED ) ), testScope, ) runCurrent() assertThat(shouldCollectFocalArea).isFalse() // Transition back to lockscreen starts, should start collecting kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( from = GONE, to = LOCKSCREEN, transitionState = TransitionState.STARTED ) ), testScope, ) runCurrent() assertThat(shouldCollectFocalArea).isTrue() // Transition to lockscreen finishes, should continue collecting (tests the merge) kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( from = GONE, to = LOCKSCREEN, transitionState = TransitionState.FINISHED ) ), testScope, ) runCurrent() assertThat(shouldCollectFocalArea).isTrue() } @Test @EnableSceneContainer fun shouldNotCollectFocalArea_isIdleInLockscreenWithDualShadeOverlays() = Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/wallpapers/domain/interactor/WallpaperFocalAreaInteractorTest.kt +51 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,57 @@ class WallpaperFocalAreaInteractorTest : SysuiTestCase() { assertThat(shouldCollectFocalArea).isFalse() } @Test @DisableSceneContainer fun shouldCollectFocalArea_whenTransitioningToLockscreen_sceneContainerDisabled() = testScope.runTest { val shouldCollectFocalArea by collectLastValue(underTest.shouldCollectFocalArea) // Initially true due to onStart assertThat(shouldCollectFocalArea).isTrue() // Transition away from lockscreen, should stop collecting kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( from = LOCKSCREEN, to = GONE, transitionState = TransitionState.STARTED ) ), testScope, ) runCurrent() assertThat(shouldCollectFocalArea).isFalse() // Transition back to lockscreen starts, should start collecting kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( from = GONE, to = LOCKSCREEN, transitionState = TransitionState.STARTED ) ), testScope, ) runCurrent() assertThat(shouldCollectFocalArea).isTrue() // Transition to lockscreen finishes, should continue collecting (tests the merge) kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps( listOf( TransitionStep( from = GONE, to = LOCKSCREEN, transitionState = TransitionState.FINISHED ) ), testScope, ) runCurrent() assertThat(shouldCollectFocalArea).isTrue() } @Test @EnableSceneContainer fun shouldNotCollectFocalArea_isIdleInLockscreenWithDualShadeOverlays() = Loading