Merge "LockscreenShadeTransitionController: add more tests for DepthController interactions" into tm-dev

This commit is contained in:
Christian Göllner
2022-03-25 09:17:46 +00:00
committed by Android (Google) Code Review

View File

@@ -255,14 +255,25 @@ class LockscreenShadeTransitionControllerTest : SysuiTestCase() {
} }
@Test @Test
fun testDragDownAmount_depthDistanceIsZero_doesNotSetProgress() { fun testDragDownAmount_depthDistanceIsZero_setsProgressToZero() {
context.getOrCreateTestableResources() context.getOrCreateTestableResources()
.addOverride(R.dimen.lockscreen_shade_depth_controller_transition_distance, 0) .addOverride(R.dimen.lockscreen_shade_depth_controller_transition_distance, 0)
configurationController.notifyConfigurationChanged() configurationController.notifyConfigurationChanged()
transitionController.dragDownAmount = 10f 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 @Test