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

Commit 89477299 authored by Mykola Podolian's avatar Mykola Podolian
Browse files

Added DisableFlags annotation for failing test

Also created test that checks the behavior when flag is enabled.

Bug: 435098356
Test: BubbleStackViewTest
Flag: com.android.wm.shell.fix_bubbles_expanded_sysui_flag
Change-Id: Ie6df8670d46aba0723999690c791de646c3b3061
parent 3df32c4e
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
@@ -240,6 +240,7 @@ class BubbleStackViewTest {
        assertThat(bubbleStackViewManager.onImeHidden).isNull()
    }

    @DisableFlags(Flags.FLAG_FIX_BUBBLES_EXPANDED_SYSUI_FLAG)
    @Test
    fun expandStack_waitsForIme() {
        val bubble = createAndInflateBubble()
@@ -269,6 +270,34 @@ class BubbleStackViewTest {
        }
    }

    @EnableFlags(Flags.FLAG_FIX_BUBBLES_EXPANDED_SYSUI_FLAG)
    @Test
    fun expandStack_sysUiProxyNotifiedImmediately() {
        val bubble = createAndInflateBubble()

        InstrumentationRegistry.getInstrumentation().runOnMainSync {
            bubbleStackView.addBubble(bubble)
        }

        InstrumentationRegistry.getInstrumentation().waitForIdleSync()
        assertThat(bubbleStackView.bubbleCount).isEqualTo(1)

        positioner.setImeVisible(true, 100)

        InstrumentationRegistry.getInstrumentation().runOnMainSync {
            // simulate a request from the bubble data listener to expand the stack
            bubbleStackView.isExpanded = true
        }

        val onImeHidden = bubbleStackViewManager.onImeHidden
        assertThat(onImeHidden).isNotNull()
        verify(sysuiProxy).onStackExpandChanged(true)
        InstrumentationRegistry.getInstrumentation().runOnMainSync {
            onImeHidden!!.run()
            shellExecutor.flushAll()
        }
    }

    @DisableFlags(Flags.FLAG_FIX_BUBBLES_EXPANDED_SYSUI_FLAG)
    @Test
    fun collapseStack_waitsForIme() {