summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/BottomHalfPipAppHelper.kt11
-rw-r--r--tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/PipAppHelper.kt5
-rw-r--r--tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/BottomHalfPipLaunchingActivity.java6
3 files changed, 19 insertions, 3 deletions
diff --git a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/BottomHalfPipAppHelper.kt b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/BottomHalfPipAppHelper.kt
index 6573c2c83f20..ed2cff4a9515 100644
--- a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/BottomHalfPipAppHelper.kt
+++ b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/BottomHalfPipAppHelper.kt
@@ -19,6 +19,7 @@ package com.android.server.wm.flicker.helpers
import android.app.Instrumentation
import android.content.Intent
import android.tools.traces.parsers.toFlickerComponent
+import android.tools.traces.parsers.WindowManagerStateHelper
import com.android.server.wm.flicker.testapp.ActivityOptions
class BottomHalfPipAppHelper(
@@ -38,4 +39,14 @@ class BottomHalfPipAppHelper(
ActivityOptions.BottomHalfPip.COMPONENT
}
}
+
+ override fun exitPipToOriginalTaskViaIntent(wmHelper: WindowManagerStateHelper) {
+ launchViaIntent(
+ wmHelper,
+ Intent().apply {
+ component = ActivityOptions.BottomHalfPip.COMPONENT
+ addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
+ }
+ )
+ }
} \ No newline at end of file
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 de17bf422c0c..344cac1ac7e5 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
@@ -75,8 +75,9 @@ open class PipAppHelper(
.waitForAndVerify()
}
- /** Expand the PIP window back to full screen via intent and wait until the app is visible */
- fun exitPipToFullScreenViaIntent(wmHelper: WindowManagerStateHelper) = launchViaIntent(wmHelper)
+ /** Expand the PIP window back to original task via intent and wait until the app is visible */
+ open fun exitPipToOriginalTaskViaIntent(wmHelper: WindowManagerStateHelper) =
+ launchViaIntent(wmHelper)
fun changeAspectRatio(wmHelper: WindowManagerStateHelper) {
val intent = Intent("com.android.wm.shell.flicker.testapp.ASPECT_RATIO")
diff --git a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/BottomHalfPipLaunchingActivity.java b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/BottomHalfPipLaunchingActivity.java
index d9d4361411bb..209f71e4f307 100644
--- a/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/BottomHalfPipLaunchingActivity.java
+++ b/tests/FlickerTests/test-apps/flickerapp/src/com/android/server/wm/flicker/testapp/BottomHalfPipLaunchingActivity.java
@@ -24,8 +24,12 @@ public class BottomHalfPipLaunchingActivity extends SimpleActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
-
final Intent intent = new Intent(this, BottomHalfPipActivity.class);
+ // Pass extras to BottomHalfPipActivity.
+ final Bundle extras = getIntent().getExtras();
+ if (extras != null) {
+ intent.putExtras(extras);
+ }
startActivity(intent);
}
}