Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/GlanceableHubToLockscreenTransitionViewModelTest.kt +41 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.platform.test.flag.junit.FlagsParameterization import android.util.LayoutDirection import androidx.test.filters.SmallTest import com.android.compose.animation.scene.ObservableTransitionState import com.android.systemui.Flags import com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_V2 import com.android.systemui.SysuiTestCase import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository Loading Loading @@ -82,7 +83,8 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test fun lockscreenFadeIn() = @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_motionFlagDisabled() = kosmos.runTest { communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") Loading Loading @@ -111,8 +113,41 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat values.forEach { assertThat(it).isIn(Range.closed(0f, 1f)) } } @Test @EnableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_motionFlagEnabled() = kosmos.runTest { communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") val values by collectValues(underTest.keyguardAlpha) assertThat(values).isEmpty() keyguardTransitionRepository.sendTransitionSteps( listOf( step(0f, TransitionState.STARTED), step(0.1f), step(0.2f), step(0.3f), // Should start running here... step(0.4f), step(0.5f), step(0.6f), step(0.7f), // ...up to here step(0.8f), step(0.9f), step(1f), ), testScope, ) assertThat(values).hasSize(4) values.forEach { assertThat(it).isIn(Range.closed(0f, 1f)) } } @Test @EnableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_fromHubInLandscape() = kosmos.runTest { kosmos.setCommunalV2ConfigEnabled(true) Loading Loading @@ -185,7 +220,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test @DisableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(FLAG_GLANCEABLE_HUB_V2, Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_v2FlagDisabledAndFromHubInLandscape() = kosmos.runTest { whenever(keyguardStateController.isKeyguardScreenRotationAllowed).thenReturn(false) Loading Loading @@ -222,6 +257,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX() = kosmos.runTest { val config: Configuration = mock() Loading Loading @@ -254,6 +290,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat @Test @EnableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX_fromHubInLandscape() = kosmos.runTest { kosmos.setCommunalV2ConfigEnabled(true) Loading Loading @@ -291,6 +328,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX_resetsAfterCancellation() = kosmos.runTest { val config: Configuration = mock() Loading Loading @@ -324,6 +362,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat @Test @EnableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX_resetsAfterCancellation_fromHubInLandscape() = kosmos.runTest { kosmos.setCommunalV2ConfigEnabled(true) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToGlanceableHubTransitionViewModelTest.kt +35 −2 Original line number Diff line number Diff line Loading @@ -17,9 +17,12 @@ package com.android.systemui.keyguard.ui.viewmodel import android.content.res.Configuration import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.util.LayoutDirection import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository import com.android.systemui.flags.DisableSceneContainer Loading Loading @@ -52,7 +55,8 @@ class LockscreenToGlanceableHubTransitionViewModelTest : SysuiTestCase() { val underTest by lazy { kosmos.lockscreenToGlanceableHubTransitionViewModel } @Test fun lockscreenFadeOut() = @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeOut_motionFlagDisabled() = kosmos.runTest { val values by collectValues(underTest.keyguardAlpha) assertThat(values).isEmpty() Loading @@ -70,7 +74,6 @@ class LockscreenToGlanceableHubTransitionViewModelTest : SysuiTestCase() { step(0.6f), step(0.7f), step(0.8f), // ...up to here step(1f), ), testScope, Loading @@ -81,6 +84,36 @@ class LockscreenToGlanceableHubTransitionViewModelTest : SysuiTestCase() { } @Test @EnableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeOut_motionFlagEnabled() = kosmos.runTest { val values by collectValues(underTest.keyguardAlpha) assertThat(values).isEmpty() keyguardTransitionRepository.sendTransitionSteps( listOf( // Should start running here step(0f, TransitionState.STARTED), step(0.1f), step(0.2f), step(0.3f), step(0.4f), step(0.5f), // ...up to here step(0.6f), step(0.7f), step(0.8f), step(1f), ), testScope, ) assertThat(values).hasSize(6) values.forEach { assertThat(it).isIn(Range.closed(0f, 1f)) } } @Test @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX() = kosmos.runTest { configurationRepository.setDimensionPixelSize( Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/GlanceableHubToLockscreenTransitionViewModelTest.kt +41 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.platform.test.flag.junit.FlagsParameterization import android.util.LayoutDirection import androidx.test.filters.SmallTest import com.android.compose.animation.scene.ObservableTransitionState import com.android.systemui.Flags import com.android.systemui.Flags.FLAG_GLANCEABLE_HUB_V2 import com.android.systemui.SysuiTestCase import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository Loading Loading @@ -82,7 +83,8 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test fun lockscreenFadeIn() = @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_motionFlagDisabled() = kosmos.runTest { communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") Loading Loading @@ -111,8 +113,41 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat values.forEach { assertThat(it).isIn(Range.closed(0f, 1f)) } } @Test @EnableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_motionFlagEnabled() = kosmos.runTest { communalSceneInteractor.changeScene(CommunalScenes.Communal, "test") val values by collectValues(underTest.keyguardAlpha) assertThat(values).isEmpty() keyguardTransitionRepository.sendTransitionSteps( listOf( step(0f, TransitionState.STARTED), step(0.1f), step(0.2f), step(0.3f), // Should start running here... step(0.4f), step(0.5f), step(0.6f), step(0.7f), // ...up to here step(0.8f), step(0.9f), step(1f), ), testScope, ) assertThat(values).hasSize(4) values.forEach { assertThat(it).isIn(Range.closed(0f, 1f)) } } @Test @EnableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_fromHubInLandscape() = kosmos.runTest { kosmos.setCommunalV2ConfigEnabled(true) Loading Loading @@ -185,7 +220,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test @DisableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(FLAG_GLANCEABLE_HUB_V2, Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeIn_v2FlagDisabledAndFromHubInLandscape() = kosmos.runTest { whenever(keyguardStateController.isKeyguardScreenRotationAllowed).thenReturn(false) Loading Loading @@ -222,6 +257,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX() = kosmos.runTest { val config: Configuration = mock() Loading Loading @@ -254,6 +290,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat @Test @EnableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX_fromHubInLandscape() = kosmos.runTest { kosmos.setCommunalV2ConfigEnabled(true) Loading Loading @@ -291,6 +328,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat } @Test @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX_resetsAfterCancellation() = kosmos.runTest { val config: Configuration = mock() Loading Loading @@ -324,6 +362,7 @@ class GlanceableHubToLockscreenTransitionViewModelTest(flags: FlagsParameterizat @Test @EnableFlags(FLAG_GLANCEABLE_HUB_V2) @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX_resetsAfterCancellation_fromHubInLandscape() = kosmos.runTest { kosmos.setCommunalV2ConfigEnabled(true) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToGlanceableHubTransitionViewModelTest.kt +35 −2 Original line number Diff line number Diff line Loading @@ -17,9 +17,12 @@ package com.android.systemui.keyguard.ui.viewmodel import android.content.res.Configuration import android.platform.test.annotations.DisableFlags import android.platform.test.annotations.EnableFlags import android.util.LayoutDirection import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest import com.android.systemui.Flags import com.android.systemui.SysuiTestCase import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository import com.android.systemui.flags.DisableSceneContainer Loading Loading @@ -52,7 +55,8 @@ class LockscreenToGlanceableHubTransitionViewModelTest : SysuiTestCase() { val underTest by lazy { kosmos.lockscreenToGlanceableHubTransitionViewModel } @Test fun lockscreenFadeOut() = @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeOut_motionFlagDisabled() = kosmos.runTest { val values by collectValues(underTest.keyguardAlpha) assertThat(values).isEmpty() Loading @@ -70,7 +74,6 @@ class LockscreenToGlanceableHubTransitionViewModelTest : SysuiTestCase() { step(0.6f), step(0.7f), step(0.8f), // ...up to here step(1f), ), testScope, Loading @@ -81,6 +84,36 @@ class LockscreenToGlanceableHubTransitionViewModelTest : SysuiTestCase() { } @Test @EnableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenFadeOut_motionFlagEnabled() = kosmos.runTest { val values by collectValues(underTest.keyguardAlpha) assertThat(values).isEmpty() keyguardTransitionRepository.sendTransitionSteps( listOf( // Should start running here step(0f, TransitionState.STARTED), step(0.1f), step(0.2f), step(0.3f), step(0.4f), step(0.5f), // ...up to here step(0.6f), step(0.7f), step(0.8f), step(1f), ), testScope, ) assertThat(values).hasSize(6) values.forEach { assertThat(it).isIn(Range.closed(0f, 1f)) } } @Test @DisableFlags(Flags.FLAG_GESTURE_BETWEEN_HUB_AND_LOCKSCREEN_MOTION) fun lockscreenTranslationX() = kosmos.runTest { configurationRepository.setDimensionPixelSize( Loading