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

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

Fix test: LockscreenShadeTransitionControllerTest

This test is currently failing on foldable targets, as the resource
`lockscreen_shade_depth_controller_transition_distance` has the value 0,
and therefore the progress is never set on the depthController.

Test: Test passes
Fixes: 223167765
Change-Id: I543784eed4791c83202bc957978419b9b83f944f
parent edcc80f4
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() {
        row = helper.createRow()
        context.getOrCreateTestableResources()
                .addOverride(R.bool.config_use_split_notification_shade, false)
        context.getOrCreateTestableResources()
            .addOverride(R.dimen.lockscreen_shade_depth_controller_transition_distance, 100)
        transitionController = LockscreenShadeTransitionController(
            statusBarStateController = statusbarStateController,
            logger = logger,
@@ -246,6 +248,17 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() {
        verify(depthController).transitionToFullShadeProgress = anyFloat()
    }

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

        transitionController.dragDownAmount = 10f

        verify(depthController, never()).transitionToFullShadeProgress
    }

    @Test
    fun setDragDownAmount_setsValueOnMediaHierarchyManager() {
        transitionController.dragDownAmount = 10f