diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt | 16 | ||||
| -rw-r--r-- | tests/Input/Android.bp | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt index 43fd57bf39aa..931e4f88aa8d 100644 --- a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt +++ b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt @@ -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) { diff --git a/tests/Input/Android.bp b/tests/Input/Android.bp index 06c2651b604d..65398a22d968 100644 --- a/tests/Input/Android.bp +++ b/tests/Input/Android.bp @@ -40,7 +40,7 @@ android_test { "frameworks-base-testutils", "hamcrest-library", "kotlin-test", - "mockito-target-minus-junit4", + "mockito-target-extended-minus-junit4", "platform-test-annotations", "platform-screenshot-diff-core", "services.core.unboosted", |