Loading libs/WindowManager/Shell/tests/e2e/bubbles/flicker-explicit/src/com/android/wm/shell/flicker/bubbles/EnterBubbleViaBubbleMenuTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ import org.junit.runners.Parameterized * * Actions: * ``` * Long press [simpleApp] icon to show [AppIconMenu]. * Click the bubble menu to launch [simpleApp] into bubble. * Long press [testApp] icon to show app icon menu. * Click the bubble menu to launch [testApp] into bubble. * ``` * Verified tests: * - [BubbleFlickerTestBase] Loading libs/WindowManager/Shell/tests/e2e/bubbles/flicker-explicit/src/com/android/wm/shell/flicker/bubbles/testcase/BubbleAppBecomesExpandedTestCases.kt +38 −0 Original line number Diff line number Diff line Loading @@ -18,8 +18,10 @@ package com.android.wm.shell.flicker.bubbles.testcase import android.tools.traces.component.ComponentNameMatcher import android.tools.traces.component.ComponentNameMatcher.Companion.BUBBLE import android.tools.traces.component.ComponentNameMatcher.Companion.BUBBLE_TASK_VIEW import android.tools.traces.component.ComponentNameMatcher.Companion.LAUNCHER import android.tools.traces.component.IComponentNameMatcher import com.android.server.wm.flicker.helpers.ImeAppHelper import com.android.wm.shell.flicker.bubbles.utils.BubbleFlickerSubjects import org.junit.Test Loading Loading @@ -145,4 +147,40 @@ interface BubbleAppBecomesExpandedTestCases : BubbleFlickerSubjects { layerTraceEntrySubjectAtEnd.visibleRegion(BUBBLE) .coversAtLeast(layerTraceEntrySubjectAtEnd.visibleRegion(testApp).region) } /** * Verifies whether the below bounds match: * - Bubble task bounds in WM hierarchy * - Bubble task layer bounds * - Bubble task view layer bounds */ @Test fun bubbleTaskBoundsMatchBubbleTaskView() { // Get the WM task bounds of bubble app. val bubbleAppTask = wmStateSubjectAtEnd.wmState.getTaskForActivity(testApp) ?: error("Bubble app task not found") val taskBounds = bubbleAppTask.bounds // Get the task layer bounds of bubble app. val taskLayer = layerTraceEntrySubjectAtEnd .findAncestorLayer(testApp) { it.isTask } ?: error("Bubble app task layer not found") val taskLayerBounds = taskLayer.screenBounds // Get the bounds of bubble task view layer. val bubbleTaskViewLayer = layerTraceEntrySubjectAtEnd .findAncestorLayer(testApp) { BUBBLE_TASK_VIEW.layerMatchesAnyOf(it) } ?: error("Bubble app task view not found") val bubbleTaskViewLayerBounds = bubbleTaskViewLayer.screenBounds if (testApp is ImeAppHelper) { // If the IME shows, the task and task view layer may be resized to fit the IME layer, // while WM task bounds remain unchanged. bubbleTaskViewLayerBounds.coversExactly(taskLayerBounds.region) bubbleTaskViewLayerBounds.coversAtMost(taskBounds) } else { // Otherwise, bubble task view bounds must match task bounds. bubbleTaskViewLayerBounds.coversExactly(taskLayerBounds.region) taskLayerBounds.coversExactly(taskBounds) } } } No newline at end of file libs/WindowManager/Shell/tests/e2e/bubbles/flicker-explicit/src/com/android/wm/shell/flicker/bubbles/utils/BubbleFlickerTestHelper.kt +5 −2 Original line number Diff line number Diff line Loading @@ -496,9 +496,12 @@ internal object BubbleFlickerTestHelper { waitAndAssertBubbleAppInExpandedState(testApp, wmHelper) // The bubble will be occluded if IME shows. if (testApp !is ImeAppHelper) { assertWithMessage("The education must not show for Application bubble") .that(Root.get().bubble.isEducationVisible).isFalse() } } private fun waitAndAssertBubbleAppInExpandedState( testApp: StandardAppHelper, Loading Loading
libs/WindowManager/Shell/tests/e2e/bubbles/flicker-explicit/src/com/android/wm/shell/flicker/bubbles/EnterBubbleViaBubbleMenuTest.kt +2 −2 Original line number Diff line number Diff line Loading @@ -39,8 +39,8 @@ import org.junit.runners.Parameterized * * Actions: * ``` * Long press [simpleApp] icon to show [AppIconMenu]. * Click the bubble menu to launch [simpleApp] into bubble. * Long press [testApp] icon to show app icon menu. * Click the bubble menu to launch [testApp] into bubble. * ``` * Verified tests: * - [BubbleFlickerTestBase] Loading
libs/WindowManager/Shell/tests/e2e/bubbles/flicker-explicit/src/com/android/wm/shell/flicker/bubbles/testcase/BubbleAppBecomesExpandedTestCases.kt +38 −0 Original line number Diff line number Diff line Loading @@ -18,8 +18,10 @@ package com.android.wm.shell.flicker.bubbles.testcase import android.tools.traces.component.ComponentNameMatcher import android.tools.traces.component.ComponentNameMatcher.Companion.BUBBLE import android.tools.traces.component.ComponentNameMatcher.Companion.BUBBLE_TASK_VIEW import android.tools.traces.component.ComponentNameMatcher.Companion.LAUNCHER import android.tools.traces.component.IComponentNameMatcher import com.android.server.wm.flicker.helpers.ImeAppHelper import com.android.wm.shell.flicker.bubbles.utils.BubbleFlickerSubjects import org.junit.Test Loading Loading @@ -145,4 +147,40 @@ interface BubbleAppBecomesExpandedTestCases : BubbleFlickerSubjects { layerTraceEntrySubjectAtEnd.visibleRegion(BUBBLE) .coversAtLeast(layerTraceEntrySubjectAtEnd.visibleRegion(testApp).region) } /** * Verifies whether the below bounds match: * - Bubble task bounds in WM hierarchy * - Bubble task layer bounds * - Bubble task view layer bounds */ @Test fun bubbleTaskBoundsMatchBubbleTaskView() { // Get the WM task bounds of bubble app. val bubbleAppTask = wmStateSubjectAtEnd.wmState.getTaskForActivity(testApp) ?: error("Bubble app task not found") val taskBounds = bubbleAppTask.bounds // Get the task layer bounds of bubble app. val taskLayer = layerTraceEntrySubjectAtEnd .findAncestorLayer(testApp) { it.isTask } ?: error("Bubble app task layer not found") val taskLayerBounds = taskLayer.screenBounds // Get the bounds of bubble task view layer. val bubbleTaskViewLayer = layerTraceEntrySubjectAtEnd .findAncestorLayer(testApp) { BUBBLE_TASK_VIEW.layerMatchesAnyOf(it) } ?: error("Bubble app task view not found") val bubbleTaskViewLayerBounds = bubbleTaskViewLayer.screenBounds if (testApp is ImeAppHelper) { // If the IME shows, the task and task view layer may be resized to fit the IME layer, // while WM task bounds remain unchanged. bubbleTaskViewLayerBounds.coversExactly(taskLayerBounds.region) bubbleTaskViewLayerBounds.coversAtMost(taskBounds) } else { // Otherwise, bubble task view bounds must match task bounds. bubbleTaskViewLayerBounds.coversExactly(taskLayerBounds.region) taskLayerBounds.coversExactly(taskBounds) } } } No newline at end of file
libs/WindowManager/Shell/tests/e2e/bubbles/flicker-explicit/src/com/android/wm/shell/flicker/bubbles/utils/BubbleFlickerTestHelper.kt +5 −2 Original line number Diff line number Diff line Loading @@ -496,9 +496,12 @@ internal object BubbleFlickerTestHelper { waitAndAssertBubbleAppInExpandedState(testApp, wmHelper) // The bubble will be occluded if IME shows. if (testApp !is ImeAppHelper) { assertWithMessage("The education must not show for Application bubble") .that(Root.get().bubble.isEducationVisible).isFalse() } } private fun waitAndAssertBubbleAppInExpandedState( testApp: StandardAppHelper, Loading