LockscreenShadeTransitionController: add more tests for DepthController interactions

Test: LockscreenShadeTransitionControllerTest
Bug: 220703613
Change-Id: Ia5a76fe2c788c186e4ee203fffc0eae93364c04d
This commit is contained in:
Christian Göllner
2022-03-23 12:07:02 +00:00
parent a3e1134c46
commit 5ea4d354d8

View File

@@ -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