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

Commit 21c84316 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Fix keyguard tests for background wm_state_refactor calls

When the background wm_state_refactor calls change happened, the test
covering the new keyguard transition is not updated accordingly.

Update the test to make the behavior matches the legacy keyguard.

Test: WindowManagerLockscreenVisibilityManagerTest
Bug: 422127126
Bug: 364930619
Flag: com.android.window.flags.ensure_keyguard_does_transition_starting
Change-Id: If4539b82abcddb6e091353078aab731badccdd91
parent 76979804
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -266,12 +266,16 @@ class WindowManagerLockscreenVisibilityManagerTest : SysuiTestCase() {
    @Test
    @RequiresFlagsEnabled(Flags.FLAG_ENSURE_KEYGUARD_DOES_TRANSITION_STARTING)
    fun setSurfaceBehindVisibility_falseSetsLockscreenVisibility_with_keyguard_shell_transitions() {
        // Show the surface behind, then hide it.
        underTest.setLockscreenShown(true)
        uiBgExecutor.runAllReady()
        verify(keyguardTransitions).startKeyguardTransition(eq(true), any())

        // Show the surface behind, then hide it.
        underTest.setSurfaceBehindVisibility(true)
        uiBgExecutor.runAllReady()
        underTest.setSurfaceBehindVisibility(false)
        uiBgExecutor.runAllReady()
        verify(keyguardTransitions).startKeyguardTransition(eq(true), any())
        verify(keyguardTransitions, times(2)).startKeyguardTransition(eq(true), any())
    }

    @Test