Loading libs/WindowManager/Shell/tests/flicker/pip/src/com/android/wm/shell/flicker/pip/PipAspectRatioChangeTest.kt +1 −18 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.tools.flicker.junit.FlickerParametersRunnerFactory import android.tools.flicker.legacy.FlickerBuilder import android.tools.flicker.legacy.LegacyFlickerTest import android.tools.flicker.legacy.LegacyFlickerTestFactory import androidx.test.filters.FlakyTest import com.android.wm.shell.flicker.pip.common.PipTransition import org.junit.FixMethodOrder import org.junit.Test Loading @@ -36,7 +35,7 @@ import org.junit.runners.Parameterized @FixMethodOrder(MethodSorters.NAME_ASCENDING) class PipAspectRatioChangeTest(flicker: LegacyFlickerTest) : PipTransition(flicker) { override val thisTransition: FlickerBuilder.() -> Unit = { transitions { pipApp.changeAspectRatio() } transitions { pipApp.changeAspectRatio(wmHelper) } } @Presubmit Loading @@ -46,22 +45,6 @@ class PipAspectRatioChangeTest(flicker: LegacyFlickerTest) : PipTransition(flick flicker.assertLayersEnd { this.visibleRegion(pipApp).isSameAspectRatio(1, 2) } } @FlakyTest(bugId = 358278071) override fun hasAtMostOnePipDismissOverlayWindow() = super.hasAtMostOnePipDismissOverlayWindow() @FlakyTest(bugId = 358278071) override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd() @FlakyTest(bugId = 358278071) override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible() @FlakyTest(bugId = 358278071) override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = super.visibleWindowsShownMoreThanOneConsecutiveEntry() companion object { /** * Creates the test configurations. Loading tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt +15 −1 Original line number Diff line number Diff line Loading @@ -269,9 +269,23 @@ open class PipAppHelper(instrumentation: Instrumentation) : /** Expand the PIP window back to full screen via intent and wait until the app is visible */ fun exitPipToFullScreenViaIntent(wmHelper: WindowManagerStateHelper) = launchViaIntent(wmHelper) fun changeAspectRatio() { fun changeAspectRatio(wmHelper: WindowManagerStateHelper) { val intent = Intent("com.android.wm.shell.flicker.testapp.ASPECT_RATIO") context.sendBroadcast(intent) // Wait on WMHelper on size change upon aspect ratio change val windowRect = getWindowRect(wmHelper) wmHelper .StateSyncBuilder() .add("pipAspectRatioChanged") { val pipAppWindow = it.wmState.visibleWindows.firstOrNull { window -> this.windowMatchesAnyOf(window) } ?: return@add false val pipRegion = pipAppWindow.frameRegion return@add pipRegion != Region(windowRect) } .waitForAndVerify() } fun clickEnterPipButton(wmHelper: WindowManagerStateHelper) { Loading Loading
libs/WindowManager/Shell/tests/flicker/pip/src/com/android/wm/shell/flicker/pip/PipAspectRatioChangeTest.kt +1 −18 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import android.tools.flicker.junit.FlickerParametersRunnerFactory import android.tools.flicker.legacy.FlickerBuilder import android.tools.flicker.legacy.LegacyFlickerTest import android.tools.flicker.legacy.LegacyFlickerTestFactory import androidx.test.filters.FlakyTest import com.android.wm.shell.flicker.pip.common.PipTransition import org.junit.FixMethodOrder import org.junit.Test Loading @@ -36,7 +35,7 @@ import org.junit.runners.Parameterized @FixMethodOrder(MethodSorters.NAME_ASCENDING) class PipAspectRatioChangeTest(flicker: LegacyFlickerTest) : PipTransition(flicker) { override val thisTransition: FlickerBuilder.() -> Unit = { transitions { pipApp.changeAspectRatio() } transitions { pipApp.changeAspectRatio(wmHelper) } } @Presubmit Loading @@ -46,22 +45,6 @@ class PipAspectRatioChangeTest(flicker: LegacyFlickerTest) : PipTransition(flick flicker.assertLayersEnd { this.visibleRegion(pipApp).isSameAspectRatio(1, 2) } } @FlakyTest(bugId = 358278071) override fun hasAtMostOnePipDismissOverlayWindow() = super.hasAtMostOnePipDismissOverlayWindow() @FlakyTest(bugId = 358278071) override fun statusBarLayerPositionAtStartAndEnd() = super.statusBarLayerPositionAtStartAndEnd() @FlakyTest(bugId = 358278071) override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible() @FlakyTest(bugId = 358278071) override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = super.visibleWindowsShownMoreThanOneConsecutiveEntry() companion object { /** * Creates the test configurations. Loading
tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt +15 −1 Original line number Diff line number Diff line Loading @@ -269,9 +269,23 @@ open class PipAppHelper(instrumentation: Instrumentation) : /** Expand the PIP window back to full screen via intent and wait until the app is visible */ fun exitPipToFullScreenViaIntent(wmHelper: WindowManagerStateHelper) = launchViaIntent(wmHelper) fun changeAspectRatio() { fun changeAspectRatio(wmHelper: WindowManagerStateHelper) { val intent = Intent("com.android.wm.shell.flicker.testapp.ASPECT_RATIO") context.sendBroadcast(intent) // Wait on WMHelper on size change upon aspect ratio change val windowRect = getWindowRect(wmHelper) wmHelper .StateSyncBuilder() .add("pipAspectRatioChanged") { val pipAppWindow = it.wmState.visibleWindows.firstOrNull { window -> this.windowMatchesAnyOf(window) } ?: return@add false val pipRegion = pipAppWindow.frameRegion return@add pipRegion != Region(windowRect) } .waitForAndVerify() } fun clickEnterPipButton(wmHelper: WindowManagerStateHelper) { Loading