Loading libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleStackViewTest.kt +47 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,7 @@ class BubbleStackViewTest { } } @DisableFlags(Flags.FLAG_FIX_BUBBLES_EXPANDED_SYSUI_FLAG) @Test fun collapseStack_waitsForIme() { val bubble = createAndInflateBubble() Loading Loading @@ -316,6 +317,52 @@ class BubbleStackViewTest { } } @EnableFlags(Flags.FLAG_FIX_BUBBLES_EXPANDED_SYSUI_FLAG) @Test fun collapseStack_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 } var onImeHidden = bubbleStackViewManager.onImeHidden assertThat(onImeHidden).isNotNull() verify(sysuiProxy).onStackExpandChanged(true) positioner.setImeVisible(false, 0) InstrumentationRegistry.getInstrumentation().runOnMainSync { onImeHidden!!.run() shellExecutor.flushAll() } bubbleStackViewManager.onImeHidden = null positioner.setImeVisible(true, 100) InstrumentationRegistry.getInstrumentation().runOnMainSync { // simulate a request from the bubble data listener to collapse the stack bubbleStackView.isExpanded = false } onImeHidden = bubbleStackViewManager.onImeHidden assertThat(onImeHidden).isNotNull() verify(sysuiProxy).onStackExpandChanged(false) positioner.setImeVisible(false, 0) InstrumentationRegistry.getInstrumentation().runOnMainSync { onImeHidden!!.run() shellExecutor.flushAll() } } @Test fun expandStack_clearsImeRunnable() { val bubble = createAndInflateBubble() Loading Loading
libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleStackViewTest.kt +47 −0 Original line number Diff line number Diff line Loading @@ -269,6 +269,7 @@ class BubbleStackViewTest { } } @DisableFlags(Flags.FLAG_FIX_BUBBLES_EXPANDED_SYSUI_FLAG) @Test fun collapseStack_waitsForIme() { val bubble = createAndInflateBubble() Loading Loading @@ -316,6 +317,52 @@ class BubbleStackViewTest { } } @EnableFlags(Flags.FLAG_FIX_BUBBLES_EXPANDED_SYSUI_FLAG) @Test fun collapseStack_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 } var onImeHidden = bubbleStackViewManager.onImeHidden assertThat(onImeHidden).isNotNull() verify(sysuiProxy).onStackExpandChanged(true) positioner.setImeVisible(false, 0) InstrumentationRegistry.getInstrumentation().runOnMainSync { onImeHidden!!.run() shellExecutor.flushAll() } bubbleStackViewManager.onImeHidden = null positioner.setImeVisible(true, 100) InstrumentationRegistry.getInstrumentation().runOnMainSync { // simulate a request from the bubble data listener to collapse the stack bubbleStackView.isExpanded = false } onImeHidden = bubbleStackViewManager.onImeHidden assertThat(onImeHidden).isNotNull() verify(sysuiProxy).onStackExpandChanged(false) positioner.setImeVisible(false, 0) InstrumentationRegistry.getInstrumentation().runOnMainSync { onImeHidden!!.run() shellExecutor.flushAll() } } @Test fun expandStack_clearsImeRunnable() { val bubble = createAndInflateBubble() Loading