From 5ea4d354d8b3bcd1f61027965f8bbd9bb5af82d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6llner?= Date: Wed, 23 Mar 2022 12:07:02 +0000 Subject: [PATCH] LockscreenShadeTransitionController: add more tests for DepthController interactions Test: LockscreenShadeTransitionControllerTest Bug: 220703613 Change-Id: Ia5a76fe2c788c186e4ee203fffc0eae93364c04d --- .../LockscreenShadeTransitionControllerTest.kt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt index 1d2a0ca3777a1..f07f21ca4fa82 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt @@ -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