Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5ea4d354 authored by Christian Göllner's avatar Christian Göllner
Browse files

LockscreenShadeTransitionController: add more tests for DepthController interactions

Test: LockscreenShadeTransitionControllerTest
Bug: 220703613
Change-Id: Ia5a76fe2c788c186e4ee203fffc0eae93364c04d
parent a3e1134c
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -250,14 +250,25 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() {
    }

    @Test
    fun testDragDownAmount_depthDistanceIsZero_doesNotSetProgress() {
    fun testDragDownAmount_depthDistanceIsZero_setsProgressToZero() {
        context.getOrCreateTestableResources()
            .addOverride(R.dimen.lockscreen_shade_depth_controller_transition_distance, 0)
        configurationController.notifyConfigurationChanged()

        transitionController.dragDownAmount = 10f

        verify(depthController, never()).transitionToFullShadeProgress
        verify(depthController).transitionToFullShadeProgress = 0f
    }

    @Test
    fun testDragDownAmount_depthDistanceNonZero_setsProgressBasedOnDistance() {
        context.getOrCreateTestableResources()
            .addOverride(R.dimen.lockscreen_shade_depth_controller_transition_distance, 100)
        configurationController.notifyConfigurationChanged()

        transitionController.dragDownAmount = 10f

        verify(depthController).transitionToFullShadeProgress = 0.1f
    }

    @Test