Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/fundamentals/EnterDesktopWithDragFlickerTest.kt +2 −3 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ import android.tools.flicker.FlickerTestFactory import android.tools.traces.component.ComponentNameMatcher.Companion.DESKTOP_WALLPAPER_ACTIVITY import com.android.wm.shell.flicker.DesktopModeBaseTest import com.android.wm.shell.flicker.utils.appWindowBecomesVisible import com.android.wm.shell.flicker.utils.appWindowHasDesktopModeInitialBoundsAtTheEnd import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.layerIsVisibleAtEnd import com.android.wm.shell.scenarios.EnterDesktopWithDrag import com.android.wm.shell.Utils import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -68,8 +68,7 @@ class EnterDesktopWithDragFlickerTest(flicker: FlickerTest) : } @Test fun appWindowHasDesktopModeInitialBoundsAtTheEnd() = flicker.appWindowHasDesktopModeInitialBoundsAtTheEnd(testApp) fun appWindowInsideDisplayBoundsAtEnd() = flicker.appWindowInsideDisplayBoundsAtEnd(testApp) @Test fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(testApp) Loading libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/keyboardshortcuts/EnterDesktopFromKeyboardShortcutFlickerTest.kt +2 −3 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ import android.tools.flicker.assertions.FlickerChecker import android.tools.traces.component.ComponentNameMatcher.Companion.DESKTOP_WALLPAPER_ACTIVITY import com.android.wm.shell.flicker.DesktopModeBaseTest import com.android.wm.shell.flicker.utils.appWindowBecomesVisible import com.android.wm.shell.flicker.utils.appWindowHasDesktopModeInitialBoundsAtTheEnd import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.layerIsVisibleAtEnd import com.android.wm.shell.scenarios.EnterDesktopFromKeyboardShortcut import com.android.wm.shell.Utils import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -65,8 +65,7 @@ class EnterDesktopFromKeyboardShortcutFlickerTest(flicker: FlickerTest) : } @Test fun appWindowHasDesktopModeInitialBoundsAtTheEnd() = flicker.appWindowHasDesktopModeInitialBoundsAtTheEnd(testApp) fun appWindowInsideDisplayBoundsAtEnd() = flicker.appWindowInsideDisplayBoundsAtEnd(testApp) @Test fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(testApp) Loading libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/utils/DesktopModeCommonAssertions.kt +1 −29 Original line number Diff line number Diff line Loading @@ -18,9 +18,6 @@ package com.android.wm.shell.flicker.utils import android.graphics.Rect import android.os.SystemProperties import android.tools.PlatformConsts import android.tools.flicker.FlickerTest import android.tools.helpers.WindowUtils import android.tools.traces.component.IComponentMatcher Loading Loading @@ -159,31 +156,6 @@ fun FlickerTest.appWindowCoversHalfScreenAtEnd( } } fun FlickerTest.appWindowHasDesktopModeInitialBoundsAtTheEnd(component: IComponentMatcher) { assertLayersEnd { val displayBounds = entry.physicalDisplayBounds ?: error("Missing physical display bounds") val stableBounds = WindowUtils.getInsetDisplayBounds(scenario.endRotation) val desktopModeInitialBoundsScale = SystemProperties.getInt("persist.wm.debug.desktop_mode_initial_bounds_scale", 72) / 100f val desiredWidth = displayBounds.width().times(desktopModeInitialBoundsScale) val desiredHeight = displayBounds.height().times(desktopModeInitialBoundsScale) val outBounds = Rect(0, 0, desiredWidth.toInt(), desiredHeight.toInt()) val xOffset = ((stableBounds.width() - desiredWidth) / 2).toInt() val yOffset = ((stableBounds.height() - desiredHeight) * PlatformConsts.DESKTOP_MODE_INITIAL_WINDOW_HEIGHT_PROPORTION + stableBounds.top) .toInt() // Position the task in screen bounds outBounds.offset(xOffset, yOffset) visibleRegion(component).coversExactly(outBounds) } } fun FlickerTest.appWindowBecomesPinned(component: IComponentMatcher) { assertWm { invoke("appWindowIsNotPinned") { it.isNotPinned(component) } Loading Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/fundamentals/EnterDesktopWithDragFlickerTest.kt +2 −3 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ import android.tools.flicker.FlickerTestFactory import android.tools.traces.component.ComponentNameMatcher.Companion.DESKTOP_WALLPAPER_ACTIVITY import com.android.wm.shell.flicker.DesktopModeBaseTest import com.android.wm.shell.flicker.utils.appWindowBecomesVisible import com.android.wm.shell.flicker.utils.appWindowHasDesktopModeInitialBoundsAtTheEnd import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.layerIsVisibleAtEnd import com.android.wm.shell.scenarios.EnterDesktopWithDrag import com.android.wm.shell.Utils import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -68,8 +68,7 @@ class EnterDesktopWithDragFlickerTest(flicker: FlickerTest) : } @Test fun appWindowHasDesktopModeInitialBoundsAtTheEnd() = flicker.appWindowHasDesktopModeInitialBoundsAtTheEnd(testApp) fun appWindowInsideDisplayBoundsAtEnd() = flicker.appWindowInsideDisplayBoundsAtEnd(testApp) @Test fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(testApp) Loading
libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/keyboardshortcuts/EnterDesktopFromKeyboardShortcutFlickerTest.kt +2 −3 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ import android.tools.flicker.assertions.FlickerChecker import android.tools.traces.component.ComponentNameMatcher.Companion.DESKTOP_WALLPAPER_ACTIVITY import com.android.wm.shell.flicker.DesktopModeBaseTest import com.android.wm.shell.flicker.utils.appWindowBecomesVisible import com.android.wm.shell.flicker.utils.appWindowHasDesktopModeInitialBoundsAtTheEnd import com.android.wm.shell.flicker.utils.appWindowOnTopAtEnd import com.android.wm.shell.flicker.utils.layerIsVisibleAtEnd import com.android.wm.shell.scenarios.EnterDesktopFromKeyboardShortcut import com.android.wm.shell.Utils import com.android.wm.shell.flicker.utils.appWindowInsideDisplayBoundsAtEnd import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith Loading Loading @@ -65,8 +65,7 @@ class EnterDesktopFromKeyboardShortcutFlickerTest(flicker: FlickerTest) : } @Test fun appWindowHasDesktopModeInitialBoundsAtTheEnd() = flicker.appWindowHasDesktopModeInitialBoundsAtTheEnd(testApp) fun appWindowInsideDisplayBoundsAtEnd() = flicker.appWindowInsideDisplayBoundsAtEnd(testApp) @Test fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(testApp) Loading
libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/utils/DesktopModeCommonAssertions.kt +1 −29 Original line number Diff line number Diff line Loading @@ -18,9 +18,6 @@ package com.android.wm.shell.flicker.utils import android.graphics.Rect import android.os.SystemProperties import android.tools.PlatformConsts import android.tools.flicker.FlickerTest import android.tools.helpers.WindowUtils import android.tools.traces.component.IComponentMatcher Loading Loading @@ -159,31 +156,6 @@ fun FlickerTest.appWindowCoversHalfScreenAtEnd( } } fun FlickerTest.appWindowHasDesktopModeInitialBoundsAtTheEnd(component: IComponentMatcher) { assertLayersEnd { val displayBounds = entry.physicalDisplayBounds ?: error("Missing physical display bounds") val stableBounds = WindowUtils.getInsetDisplayBounds(scenario.endRotation) val desktopModeInitialBoundsScale = SystemProperties.getInt("persist.wm.debug.desktop_mode_initial_bounds_scale", 72) / 100f val desiredWidth = displayBounds.width().times(desktopModeInitialBoundsScale) val desiredHeight = displayBounds.height().times(desktopModeInitialBoundsScale) val outBounds = Rect(0, 0, desiredWidth.toInt(), desiredHeight.toInt()) val xOffset = ((stableBounds.width() - desiredWidth) / 2).toInt() val yOffset = ((stableBounds.height() - desiredHeight) * PlatformConsts.DESKTOP_MODE_INITIAL_WINDOW_HEIGHT_PROPORTION + stableBounds.top) .toInt() // Position the task in screen bounds outBounds.offset(xOffset, yOffset) visibleRegion(component).coversExactly(outBounds) } } fun FlickerTest.appWindowBecomesPinned(component: IComponentMatcher) { assertWm { invoke("appWindowIsNotPinned") { it.isNotPinned(component) } Loading