summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt6
-rw-r--r--tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/PipActivity.java6
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt
index c30786f4e1c4..da51eff24dc1 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt
@@ -17,6 +17,7 @@
package com.android.server.wm.flicker.helpers
import android.app.Instrumentation
+import android.content.Intent
import android.media.session.MediaController
import android.media.session.MediaSessionManager
import android.tools.common.datatypes.Rect
@@ -267,6 +268,11 @@ open class PipAppHelper(instrumentation: Instrumentation) :
fun exitPipToFullScreenViaIntent(wmHelper: WindowManagerStateHelper) =
launchViaIntent(wmHelper)
+ fun changeAspectRatio() {
+ val intent = Intent("com.android.wm.shell.flicker.testapp.ASPECT_RATIO")
+ context.sendBroadcast(intent)
+ }
+
fun clickEnterPipButton(wmHelper: WindowManagerStateHelper) {
clickObject(ENTER_PIP_BUTTON_ID)
diff --git a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/PipActivity.java b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/PipActivity.java
index cdb1d42bd4f2..12eaad108fc6 100644
--- a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/PipActivity.java
+++ b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/PipActivity.java
@@ -82,6 +82,8 @@ public class PipActivity extends Activity {
"com.android.wm.shell.flicker.testapp.SWITCH_OFF";
private static final String ACTION_SWITCH_ON = "com.android.wm.shell.flicker.testapp.SWITCH_ON";
private static final String ACTION_CLEAR = "com.android.wm.shell.flicker.testapp.CLEAR";
+ private static final String ACTION_ASPECT_RATIO =
+ "com.android.wm.shell.flicker.testapp.ASPECT_RATIO";
private final PictureInPictureParams.Builder mPipParamsBuilder =
new PictureInPictureParams.Builder()
@@ -109,6 +111,9 @@ public class PipActivity extends Activity {
case ACTION_CLEAR:
mPipParamsBuilder.setActions(Collections.emptyList());
break;
+ case ACTION_ASPECT_RATIO:
+ mPipParamsBuilder.setAspectRatio(RATIO_TALL);
+ break;
case ACTION_NO_OP:
return;
default:
@@ -190,6 +195,7 @@ public class PipActivity extends Activity {
filter.addAction(ACTION_CLEAR);
filter.addAction(ACTION_SET_REQUESTED_ORIENTATION);
filter.addAction(ACTION_ENTER_PIP);
+ filter.addAction(ACTION_ASPECT_RATIO);
registerReceiver(mBroadcastReceiver, filter);
handleIntentExtra(getIntent());