Merge changes from topic "sync-flicker-sc-v2-dev" into sc-v2-dev
* changes: [DO NOT MERGE] Dump windowing mode in Winscope traces [DO NOT MERGE] Dump SurfaceControl's layerId to proto [DO NOT MERGE] Dump WindowContainer SurfaceControls to proto [DO NOT MERGE] Expose SurfaceControl's native mLayerId property to Java [DO NOT MERGE] Sync flicker from master to sc-v2
This commit is contained in:
committed by
Android (Google) Code Review
commit
2461e951b9
@@ -23,6 +23,7 @@ import static android.graphics.Matrix.MSKEW_Y;
|
||||
import static android.graphics.Matrix.MTRANS_X;
|
||||
import static android.graphics.Matrix.MTRANS_Y;
|
||||
import static android.view.SurfaceControlProto.HASH_CODE;
|
||||
import static android.view.SurfaceControlProto.LAYER_ID;
|
||||
import static android.view.SurfaceControlProto.NAME;
|
||||
|
||||
import android.annotation.FloatRange;
|
||||
@@ -242,6 +243,7 @@ public final class SurfaceControl implements Parcelable {
|
||||
private static native int nativeGetGPUContextPriority();
|
||||
private static native void nativeSetTransformHint(long nativeObject, int transformHint);
|
||||
private static native int nativeGetTransformHint(long nativeObject);
|
||||
private static native int nativeGetLayerId(long nativeObject);
|
||||
|
||||
@Nullable
|
||||
@GuardedBy("mLock")
|
||||
@@ -357,8 +359,6 @@ public final class SurfaceControl implements Parcelable {
|
||||
@GuardedBy("mLock")
|
||||
private int mHeight;
|
||||
|
||||
private int mTransformHint;
|
||||
|
||||
private WeakReference<View> mLocalOwnerView;
|
||||
|
||||
static GlobalTransactionWrapper sGlobalTransaction;
|
||||
@@ -1541,6 +1541,7 @@ public final class SurfaceControl implements Parcelable {
|
||||
final long token = proto.start(fieldId);
|
||||
proto.write(HASH_CODE, System.identityHashCode(this));
|
||||
proto.write(NAME, mName);
|
||||
proto.write(LAYER_ID, getLayerId());
|
||||
proto.end(token);
|
||||
}
|
||||
|
||||
@@ -3675,4 +3676,15 @@ public final class SurfaceControl implements Parcelable {
|
||||
public void setTransformHint(@Surface.Rotation int transformHint) {
|
||||
nativeSetTransformHint(mNativeObject, transformHint);
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public int getLayerId() {
|
||||
if (mNativeObject != 0) {
|
||||
return nativeGetLayerId(mNativeObject);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1827,6 +1827,12 @@ static jint nativeGetTransformHint(JNIEnv* env, jclass clazz, jlong nativeSurfac
|
||||
return toRotationInt(ui::Transform::toRotation((transformHintRotationFlags)));
|
||||
}
|
||||
|
||||
static jint nativeGetLayerId(JNIEnv* env, jclass clazz, jlong nativeSurfaceControl) {
|
||||
sp<SurfaceControl> surface(reinterpret_cast<SurfaceControl*>(nativeSurfaceControl));
|
||||
|
||||
return surface->getLayerId();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static const JNINativeMethod sSurfaceControlMethods[] = {
|
||||
@@ -2026,6 +2032,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
|
||||
(void*)nativeSetTrustedOverlay },
|
||||
{"nativeSetDropInputMode", "(JJI)V",
|
||||
(void*)nativeSetDropInputMode },
|
||||
{"nativeGetLayerId", "(J)I",
|
||||
(void*)nativeGetLayerId },
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
||||
@@ -480,6 +480,7 @@ message WindowContainerProto {
|
||||
optional SurfaceAnimatorProto surface_animator = 4;
|
||||
repeated WindowContainerChildProto children = 5;
|
||||
optional IdentifierProto identifier = 6;
|
||||
optional .android.view.SurfaceControlProto surface_control = 7;
|
||||
}
|
||||
|
||||
/* represents a generic child of a WindowContainer */
|
||||
|
||||
@@ -29,4 +29,5 @@ message SurfaceControlProto {
|
||||
|
||||
optional int32 hash_code = 1;
|
||||
optional string name = 2 [ (android.privacy).dest = DEST_EXPLICIT ];
|
||||
optional int32 layerId = 3;
|
||||
}
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("CommonAssertions")
|
||||
package com.android.wm.shell.flicker
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.graphics.Region
|
||||
import android.view.Surface
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
|
||||
fun FlickerTestParameter.appPairsDividerIsVisibleAtEnd() {
|
||||
assertLayersEnd {
|
||||
@@ -72,7 +73,7 @@ fun FlickerTestParameter.dockedStackDividerNotExistsAtEnd() {
|
||||
|
||||
fun FlickerTestParameter.appPairsPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
primaryComponent: ComponentName
|
||||
primaryComponent: FlickerComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = layer(APP_PAIR_SPLIT_DIVIDER_COMPONENT).visibleRegion.region
|
||||
@@ -83,7 +84,7 @@ fun FlickerTestParameter.appPairsPrimaryBoundsIsVisibleAtEnd(
|
||||
|
||||
fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
primaryComponent: ComponentName
|
||||
primaryComponent: FlickerComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region
|
||||
@@ -94,7 +95,7 @@ fun FlickerTestParameter.dockedStackPrimaryBoundsIsVisibleAtEnd(
|
||||
|
||||
fun FlickerTestParameter.appPairsSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
secondaryComponent: ComponentName
|
||||
secondaryComponent: FlickerComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = layer(APP_PAIR_SPLIT_DIVIDER_COMPONENT).visibleRegion.region
|
||||
@@ -105,7 +106,7 @@ fun FlickerTestParameter.appPairsSecondaryBoundsIsVisibleAtEnd(
|
||||
|
||||
fun FlickerTestParameter.dockedStackSecondaryBoundsIsVisibleAtEnd(
|
||||
rotation: Int,
|
||||
secondaryComponent: ComponentName
|
||||
secondaryComponent: FlickerComponentName
|
||||
) {
|
||||
assertLayersEnd {
|
||||
val dividerRegion = layer(DOCKED_STACK_DIVIDER_COMPONENT).visibleRegion.region
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
@file:JvmName("CommonConstants")
|
||||
package com.android.wm.shell.flicker
|
||||
|
||||
import android.content.ComponentName
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
|
||||
const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui"
|
||||
val APP_PAIR_SPLIT_DIVIDER_COMPONENT = ComponentName("", "AppPairSplitDivider#")
|
||||
val DOCKED_STACK_DIVIDER_COMPONENT = ComponentName("", "DockedStackDivider#")
|
||||
val APP_PAIR_SPLIT_DIVIDER_COMPONENT = FlickerComponentName("", "AppPairSplitDivider#")
|
||||
val DOCKED_STACK_DIVIDER_COMPONENT = FlickerComponentName("", "DockedStackDivider#")
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("WaitUtils")
|
||||
package com.android.wm.shell.flicker
|
||||
|
||||
import android.os.SystemClock
|
||||
|
||||
@@ -100,8 +100,8 @@ class AppPairsTestCannotPairNonResizeableApps(
|
||||
"Non resizeable app not initialized"
|
||||
}
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.component)
|
||||
isInvisible(primaryApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
isAppWindowInvisible(primaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ class AppPairsTestPairPrimaryAndSecondaryApps(
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(primaryApp.component)
|
||||
isVisible(secondaryApp.component)
|
||||
isAppWindowVisible(primaryApp.component)
|
||||
isAppWindowVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,8 +100,8 @@ class AppPairsTestSupportPairNonResizeableApps(
|
||||
"Non resizeable app not initialized"
|
||||
}
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.component)
|
||||
isVisible(primaryApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
isAppWindowVisible(primaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,8 +81,8 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps(
|
||||
@Test
|
||||
fun bothAppWindowsInvisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isInvisible(primaryApp.component)
|
||||
isInvisible(secondaryApp.component)
|
||||
isAppWindowInvisible(primaryApp.component)
|
||||
isAppWindowInvisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.wm.shell.flicker.helpers.AppPairsHelper
|
||||
import com.android.wm.shell.flicker.helpers.BaseAppHelper
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.getDevEnableNonResizableMultiWindow
|
||||
@@ -55,7 +56,7 @@ abstract class AppPairsTransition(protected val testSpec: FlickerTestParameter)
|
||||
protected val activityHelper = ActivityHelper.getInstance()
|
||||
protected val appPairsHelper = AppPairsHelper(instrumentation,
|
||||
Components.SplitScreenActivity.LABEL,
|
||||
Components.SplitScreenActivity.COMPONENT)
|
||||
Components.SplitScreenActivity.COMPONENT.toFlickerComponent())
|
||||
|
||||
protected val primaryApp = SplitScreenHelper.getPrimary(instrumentation)
|
||||
protected val secondaryApp = SplitScreenHelper.getSecondary(instrumentation)
|
||||
|
||||
@@ -73,8 +73,8 @@ class RotateTwoLaunchedAppsInAppPairsMode(
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(primaryApp.component)
|
||||
.isVisible(secondaryApp.component)
|
||||
isAppWindowVisible(primaryApp.component)
|
||||
isAppWindowVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode(
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(primaryApp.component)
|
||||
isVisible(secondaryApp.component)
|
||||
isAppWindowVisible(primaryApp.component)
|
||||
isAppWindowVisible(secondaryApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.graphics.Region
|
||||
import com.android.server.wm.flicker.Flicker
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
|
||||
class AppPairsHelper(
|
||||
instrumentation: Instrumentation,
|
||||
activityLabel: String,
|
||||
component: ComponentName
|
||||
component: FlickerComponentName
|
||||
) : BaseAppHelper(instrumentation, activityLabel, component) {
|
||||
fun getPrimaryBounds(dividerBounds: Region): android.graphics.Region {
|
||||
val primaryAppBounds = Region(0, 0, dividerBounds.bounds.right,
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.content.pm.PackageManager.FEATURE_LEANBACK
|
||||
import android.content.pm.PackageManager.FEATURE_LEANBACK_ONLY
|
||||
import android.os.SystemProperties
|
||||
@@ -28,13 +27,13 @@ import androidx.test.uiautomator.UiObject2
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.compatibility.common.util.SystemUtil
|
||||
import com.android.server.wm.flicker.helpers.StandardAppHelper
|
||||
import com.android.server.wm.traces.parser.toWindowName
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import java.io.IOException
|
||||
|
||||
abstract class BaseAppHelper(
|
||||
instrumentation: Instrumentation,
|
||||
launcherName: String,
|
||||
component: ComponentName
|
||||
component: FlickerComponentName
|
||||
) : StandardAppHelper(
|
||||
instrumentation,
|
||||
launcherName,
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
|
||||
class FixedAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
instrumentation,
|
||||
Components.FixedActivity.LABEL,
|
||||
Components.FixedActivity.COMPONENT
|
||||
Components.FixedActivity.COMPONENT.toFlickerComponent()
|
||||
)
|
||||
@@ -21,13 +21,14 @@ import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.helpers.FIND_TIMEOUT
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
|
||||
open class ImeAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
instrumentation,
|
||||
Components.ImeActivity.LABEL,
|
||||
Components.ImeActivity.COMPONENT
|
||||
Components.ImeActivity.COMPONENT.toFlickerComponent()
|
||||
) {
|
||||
/**
|
||||
* Opens the IME and wait for it to be displayed
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.provider.Settings
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
|
||||
class MultiWindowHelper(
|
||||
instrumentation: Instrumentation,
|
||||
activityLabel: String,
|
||||
componentsInfo: ComponentName
|
||||
componentsInfo: FlickerComponentName
|
||||
) : BaseAppHelper(instrumentation, activityLabel, componentsInfo) {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -26,6 +26,7 @@ import androidx.test.uiautomator.BySelector
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.helpers.FIND_TIMEOUT
|
||||
import com.android.server.wm.flicker.helpers.SYSTEMUI_PACKAGE
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.wm.shell.flicker.pip.tv.closeTvPipWindow
|
||||
import com.android.wm.shell.flicker.pip.tv.isFocusedOrHasFocusedChild
|
||||
@@ -34,7 +35,7 @@ import com.android.wm.shell.flicker.testapp.Components
|
||||
class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
instrumentation,
|
||||
Components.PipActivity.LABEL,
|
||||
Components.PipActivity.COMPONENT
|
||||
Components.PipActivity.COMPONENT.toFlickerComponent()
|
||||
) {
|
||||
private val mediaSessionManager: MediaSessionManager
|
||||
get() = context.getSystemService(MediaSessionManager::class.java)
|
||||
@@ -129,7 +130,7 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
}
|
||||
|
||||
/**
|
||||
* Expands the pip window and dismisses it by clicking on the X button.
|
||||
* Taps the pip window and dismisses it by clicking on the X button.
|
||||
*/
|
||||
fun closePipWindow(wmHelper: WindowManagerStateHelper) {
|
||||
if (isTelevision) {
|
||||
@@ -137,9 +138,12 @@ class PipAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
} else {
|
||||
val windowRect = getWindowRect(wmHelper)
|
||||
uiDevice.click(windowRect.centerX(), windowRect.centerY())
|
||||
val exitPipObject = uiDevice.findObject(By.res(SYSTEMUI_PACKAGE, "dismiss"))
|
||||
// search and interact with the dismiss button
|
||||
val dismissSelector = By.res(SYSTEMUI_PACKAGE, "dismiss")
|
||||
uiDevice.wait(Until.hasObject(dismissSelector), FIND_TIMEOUT)
|
||||
val dismissPipObject = uiDevice.findObject(dismissSelector)
|
||||
?: error("PIP window dismiss button not found")
|
||||
val dismissButtonBounds = exitPipObject.visibleBounds
|
||||
val dismissButtonBounds = dismissPipObject.visibleBounds
|
||||
uiDevice.click(dismissButtonBounds.centerX(), dismissButtonBounds.centerY())
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,11 @@
|
||||
package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
|
||||
class SimpleAppHelper(instrumentation: Instrumentation) : BaseAppHelper(
|
||||
instrumentation,
|
||||
Components.SimpleActivity.LABEL,
|
||||
Components.SimpleActivity.COMPONENT
|
||||
Components.SimpleActivity.COMPONENT.toFlickerComponent()
|
||||
)
|
||||
@@ -17,14 +17,15 @@
|
||||
package com.android.wm.shell.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.content.res.Resources
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
|
||||
class SplitScreenHelper(
|
||||
instrumentation: Instrumentation,
|
||||
activityLabel: String,
|
||||
componentsInfo: ComponentName
|
||||
componentsInfo: FlickerComponentName
|
||||
) : BaseAppHelper(instrumentation, activityLabel, componentsInfo) {
|
||||
|
||||
companion object {
|
||||
@@ -39,16 +40,16 @@ class SplitScreenHelper(
|
||||
fun getPrimary(instrumentation: Instrumentation): SplitScreenHelper =
|
||||
SplitScreenHelper(instrumentation,
|
||||
Components.SplitScreenActivity.LABEL,
|
||||
Components.SplitScreenActivity.COMPONENT)
|
||||
Components.SplitScreenActivity.COMPONENT.toFlickerComponent())
|
||||
|
||||
fun getSecondary(instrumentation: Instrumentation): SplitScreenHelper =
|
||||
SplitScreenHelper(instrumentation,
|
||||
Components.SplitScreenSecondaryActivity.LABEL,
|
||||
Components.SplitScreenSecondaryActivity.COMPONENT)
|
||||
Components.SplitScreenSecondaryActivity.COMPONENT.toFlickerComponent())
|
||||
|
||||
fun getNonResizeable(instrumentation: Instrumentation): SplitScreenHelper =
|
||||
SplitScreenHelper(instrumentation,
|
||||
Components.NonResizeableActivity.LABEL,
|
||||
Components.NonResizeableActivity.COMPONENT)
|
||||
Components.NonResizeableActivity.COMPONENT.toFlickerComponent())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
@@ -25,13 +24,13 @@ import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
@@ -50,7 +49,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
@Group4
|
||||
class EnterSplitScreenDockActivity(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
@@ -62,10 +61,10 @@ class EnterSplitScreenDockActivity(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, LIVE_WALLPAPER_COMPONENT,
|
||||
splitScreenApp.component, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT, LAUNCHER_COMPONENT)
|
||||
splitScreenApp.component, FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT, LAUNCHER_COMPONENT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -89,7 +88,7 @@ class EnterSplitScreenDockActivity(
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.component)
|
||||
isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -43,6 +43,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@Group4
|
||||
class EnterSplitScreenFromDetachedRecentTask(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
@@ -62,10 +63,10 @@ class EnterSplitScreenFromDetachedRecentTask(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Presubmit
|
||||
@@ -76,7 +77,7 @@ class EnterSplitScreenFromDetachedRecentTask(
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.component)
|
||||
isAppWindowVisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,21 +16,20 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.dockedStackDividerBecomesVisible
|
||||
import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisibleAtEnd
|
||||
@@ -49,7 +48,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
@Group4
|
||||
class EnterSplitScreenLaunchToSide(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
@@ -62,10 +61,10 @@ class EnterSplitScreenLaunchToSide(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, splitScreenApp.component,
|
||||
secondaryApp.component, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
secondaryApp.component, FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -92,7 +91,7 @@ class EnterSplitScreenLaunchToSide(
|
||||
// Because we log WM once per frame, sometimes the activity and the window
|
||||
// become visible in the same entry, sometimes not, thus it is not possible to
|
||||
// assert the visibility of the activity here
|
||||
this.isAppWindowInvisible(secondaryApp.component, ignoreActivity = true)
|
||||
this.isAppWindowInvisible(secondaryApp.component)
|
||||
.then()
|
||||
// during re-parenting, the window may disappear and reappear from the
|
||||
// trace, this occurs because we log only 1x per frame
|
||||
|
||||
@@ -16,17 +16,16 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.canSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
@@ -51,7 +50,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@Group1
|
||||
@Group4
|
||||
class EnterSplitScreenNotSupportNonResizable(
|
||||
testSpec: FlickerTestParameter
|
||||
) : LegacySplitScreenTransition(testSpec) {
|
||||
@@ -71,10 +70,10 @@ class EnterSplitScreenNotSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT,
|
||||
nonResizeableApp.component,
|
||||
splitScreenApp.component)
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -26,7 +25,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setSupportsNonResizableMultiWindow
|
||||
@@ -68,12 +67,12 @@ class EnterSplitScreenSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
nonResizeableApp.component,
|
||||
splitScreenApp.component)
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT,
|
||||
nonResizeableApp.component,
|
||||
splitScreenApp.component)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -95,7 +94,7 @@ class EnterSplitScreenSupportNonResizable(
|
||||
@Test
|
||||
fun appWindowIsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(nonResizeableApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -30,7 +29,7 @@ import com.android.server.wm.flicker.helpers.exitSplitScreenFromBottom
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -70,10 +69,10 @@ class ExitLegacySplitScreenFromBottom(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, FlickerComponentName.SPLASH_SCREEN,
|
||||
splitScreenApp.component, secondaryApp.component,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Postsubmit
|
||||
@Test
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -30,7 +29,7 @@ import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -70,10 +69,10 @@ class ExitPrimarySplitScreenShowSecondaryFullscreen(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, FlickerComponentName.SPLASH_SCREEN,
|
||||
splitScreenApp.component, secondaryApp.component,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -26,7 +25,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
@@ -69,11 +68,11 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
nonResizeableApp.component, splitScreenApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
nonResizeableApp.component, splitScreenApp.component,
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -120,12 +119,12 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
// when the activity gets PAUSED the window may still be marked as visible
|
||||
// it will be updated in the next log entry. This occurs because we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
this.isAppWindowVisible(splitScreenApp.component, ignoreActivity = true)
|
||||
this.isAppWindowVisible(splitScreenApp.component)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowInvisible(splitScreenApp.component, ignoreActivity = true)
|
||||
.isAppWindowInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,13 +141,12 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
.then()
|
||||
// we log once per frame, upon logging, window may be visible or not depending
|
||||
// on what was processed until that moment. Both behaviors are correct
|
||||
.isAppWindowInvisible(nonResizeableApp.component,
|
||||
ignoreActivity = true, isOptional = true)
|
||||
.isAppWindowInvisible(nonResizeableApp.component, isOptional = true)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowVisible(nonResizeableApp.component, ignoreActivity = true)
|
||||
.isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +157,7 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
@Test
|
||||
fun nonResizableAppWindowBecomesVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
this.isVisible(nonResizeableApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,8 +169,8 @@ class LegacySplitScreenFromIntentNotSupportNonResizable(
|
||||
@Test
|
||||
fun onlyNonResizableAppWindowIsVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isInvisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isAppWindowInvisible(splitScreenApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -26,7 +25,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
@@ -69,11 +68,11 @@ class LegacySplitScreenFromIntentSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
nonResizeableApp.component, splitScreenApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -110,13 +109,12 @@ class LegacySplitScreenFromIntentSupportNonResizable(
|
||||
.then()
|
||||
// we log once per frame, upon logging, window may be visible or not depending
|
||||
// on what was processed until that moment. Both behaviors are correct
|
||||
.isAppWindowInvisible(nonResizeableApp.component,
|
||||
ignoreActivity = true, isOptional = true)
|
||||
.isAppWindowInvisible(nonResizeableApp.component, isOptional = true)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowVisible(nonResizeableApp.component, ignoreActivity = true)
|
||||
.isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,8 +126,8 @@ class LegacySplitScreenFromIntentSupportNonResizable(
|
||||
@Test
|
||||
fun bothAppsWindowsAreVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isAppWindowVisible(splitScreenApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
@@ -28,7 +27,7 @@ import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerNotExistsAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
@@ -71,11 +70,11 @@ class LegacySplitScreenFromRecentNotSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
TOAST_COMPONENT, splitScreenApp.component, nonResizeableApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
TOAST_COMPONENT, splitScreenApp.component, nonResizeableApp.component,
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -116,12 +115,12 @@ class LegacySplitScreenFromRecentNotSupportNonResizable(
|
||||
// when the activity gets PAUSED the window may still be marked as visible
|
||||
// it will be updated in the next log entry. This occurs because we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
this.isAppWindowVisible(splitScreenApp.component, ignoreActivity = true)
|
||||
this.isAppWindowVisible(splitScreenApp.component)
|
||||
.then()
|
||||
// immediately after the window (after onResume and before perform relayout)
|
||||
// the activity is invisible. This may or not be logged, since we record 1x
|
||||
// per frame, thus ignore activity check here
|
||||
.isAppWindowInvisible(splitScreenApp.component, ignoreActivity = true)
|
||||
.isAppWindowInvisible(splitScreenApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,8 +142,8 @@ class LegacySplitScreenFromRecentNotSupportNonResizable(
|
||||
@Test
|
||||
fun onlyNonResizableAppWindowIsVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isInvisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isAppWindowInvisible(splitScreenApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.RequiresDevice
|
||||
@@ -27,7 +26,7 @@ import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.reopenAppFromOverview
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.dockedStackDividerIsVisibleAtEnd
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.resetMultiWindowConfig
|
||||
@@ -70,11 +69,11 @@ class LegacySplitScreenFromRecentSupportNonResizable(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(DOCKED_STACK_DIVIDER_COMPONENT, LAUNCHER_COMPONENT, LETTERBOX_COMPONENT,
|
||||
TOAST_COMPONENT, splitScreenApp.component, nonResizeableApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
TOAST_COMPONENT, splitScreenApp.component, nonResizeableApp.component,
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Before
|
||||
override fun setup() {
|
||||
@@ -107,7 +106,7 @@ class LegacySplitScreenFromRecentSupportNonResizable(
|
||||
// Because we log WM once per frame, sometimes the activity and the window
|
||||
// become visible in the same entry, sometimes not, thus it is not possible to
|
||||
// assert the visibility of the activity here
|
||||
this.isAppWindowInvisible(nonResizeableApp.component, ignoreActivity = true)
|
||||
this.isAppWindowInvisible(nonResizeableApp.component)
|
||||
.then()
|
||||
// during re-parenting, the window may disappear and reappear from the
|
||||
// trace, this occurs because we log only 1x per frame
|
||||
@@ -129,8 +128,8 @@ class LegacySplitScreenFromRecentSupportNonResizable(
|
||||
@Test
|
||||
fun bothAppsWindowsAreVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(splitScreenApp.component)
|
||||
isVisible(nonResizeableApp.component)
|
||||
isAppWindowVisible(splitScreenApp.component)
|
||||
isAppWindowVisible(nonResizeableApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
@@ -39,7 +38,7 @@ import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.dockedStackDividerBecomesInvisible
|
||||
import com.android.wm.shell.flicker.helpers.SimpleAppHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -86,9 +85,9 @@ class LegacySplitScreenToLauncher(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@Presubmit
|
||||
@Test
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import android.view.Surface
|
||||
@@ -32,7 +31,7 @@ import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.helpers.BaseAppHelper.Companion.isShellTransitionsEnabled
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.getDevEnableNonResizableMultiWindow
|
||||
import com.android.wm.shell.flicker.helpers.MultiWindowHelper.Companion.setDevEnableNonResizableMultiWindow
|
||||
@@ -50,7 +49,7 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
protected val splitScreenApp = SplitScreenHelper.getPrimary(instrumentation)
|
||||
protected val secondaryApp = SplitScreenHelper.getSecondary(instrumentation)
|
||||
protected val nonResizeableApp = SplitScreenHelper.getNonResizeable(instrumentation)
|
||||
protected val LAUNCHER_COMPONENT = ComponentName("",
|
||||
protected val LAUNCHER_COMPONENT = FlickerComponentName("",
|
||||
LauncherStrategyFactory.getInstance(instrumentation)
|
||||
.launcherStrategy.supportedLauncherPackage)
|
||||
private var prevDevEnableNonResizableMultiWindow = 0
|
||||
@@ -79,9 +78,9 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
*
|
||||
* b/182720234
|
||||
*/
|
||||
open val ignoredWindows: List<ComponentName> = listOf(
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
open val ignoredWindows: List<FlickerComponentName> = listOf(
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
protected open val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = { configuration ->
|
||||
@@ -148,9 +147,9 @@ abstract class LegacySplitScreenTransition(protected val testSpec: FlickerTestPa
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal val LIVE_WALLPAPER_COMPONENT = ComponentName("",
|
||||
internal val LIVE_WALLPAPER_COMPONENT = FlickerComponentName("",
|
||||
"com.breel.wallpapers18.soundviz.wallpaper.variations.SoundVizWallpaperV2")
|
||||
internal val LETTERBOX_COMPONENT = ComponentName("", "Letterbox")
|
||||
internal val TOAST_COMPONENT = ComponentName("", "Toast")
|
||||
internal val LETTERBOX_COMPONENT = FlickerComponentName("", "Letterbox")
|
||||
internal val TOAST_COMPONENT = FlickerComponentName("", "Toast")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.wm.shell.flicker.legacysplitscreen
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import androidx.test.filters.FlakyTest
|
||||
@@ -29,7 +28,7 @@ import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.appPairsDividerBecomesVisible
|
||||
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
|
||||
import org.junit.FixMethodOrder
|
||||
@@ -59,10 +58,10 @@ class OpenAppToLegacySplitScreen(
|
||||
}
|
||||
}
|
||||
|
||||
override val ignoredWindows: List<ComponentName>
|
||||
override val ignoredWindows: List<FlickerComponentName>
|
||||
get() = listOf(LAUNCHER_COMPONENT, splitScreenApp.component,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT)
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT)
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
|
||||
@@ -42,6 +42,7 @@ import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.wm.shell.flicker.DOCKED_STACK_DIVIDER_COMPONENT
|
||||
import com.android.wm.shell.flicker.helpers.SimpleAppHelper
|
||||
import com.android.wm.shell.flicker.testapp.Components
|
||||
@@ -110,7 +111,7 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun topAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(Components.SimpleActivity.COMPONENT)
|
||||
this.isAppWindowVisible(Components.SimpleActivity.COMPONENT.toFlickerComponent())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +119,7 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun bottomAppWindowIsAlwaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(Components.ImeActivity.COMPONENT)
|
||||
this.isAppWindowVisible(Components.ImeActivity.COMPONENT.toFlickerComponent())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,14 +143,14 @@ class ResizeLegacySplitScreen(
|
||||
@Test
|
||||
fun topAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(Components.SimpleActivity.COMPONENT)
|
||||
this.isVisible(Components.SimpleActivity.COMPONENT.toFlickerComponent())
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bottomAppLayerIsAlwaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(Components.ImeActivity.COMPONENT)
|
||||
this.isVisible(Components.ImeActivity.COMPONENT.toFlickerComponent())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,8 +175,10 @@ class ResizeLegacySplitScreen(
|
||||
dividerBounds.bottom - WindowUtils.dockedStackDividerInset,
|
||||
displayBounds.right,
|
||||
displayBounds.bottom - WindowUtils.navigationBarHeight)
|
||||
visibleRegion(Components.SimpleActivity.COMPONENT).coversExactly(topAppBounds)
|
||||
visibleRegion(Components.ImeActivity.COMPONENT).coversExactly(bottomAppBounds)
|
||||
visibleRegion(Components.SimpleActivity.COMPONENT.toFlickerComponent())
|
||||
.coversExactly(topAppBounds)
|
||||
visibleRegion(Components.ImeActivity.COMPONENT.toFlickerComponent())
|
||||
.coversExactly(bottomAppBounds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,8 +197,10 @@ class ResizeLegacySplitScreen(
|
||||
displayBounds.right,
|
||||
displayBounds.bottom - WindowUtils.navigationBarHeight)
|
||||
|
||||
visibleRegion(Components.SimpleActivity.COMPONENT).coversExactly(topAppBounds)
|
||||
visibleRegion(Components.ImeActivity.COMPONENT).coversExactly(bottomAppBounds)
|
||||
visibleRegion(Components.SimpleActivity.COMPONENT.toFlickerComponent())
|
||||
.coversExactly(topAppBounds)
|
||||
visibleRegion(Components.ImeActivity.COMPONENT.toFlickerComponent())
|
||||
.coversExactly(bottomAppBounds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class RotateTwoLaunchedAppAndEnterSplitScreen(
|
||||
// Because we log WM once per frame, sometimes the activity and the window
|
||||
// become visible in the same entry, sometimes not, thus it is not possible to
|
||||
// assert the visibility of the activity here
|
||||
this.isAppWindowInvisible(secondaryApp.component, ignoreActivity = true)
|
||||
this.isAppWindowInvisible(secondaryApp.component)
|
||||
.then()
|
||||
// during re-parenting, the window may disappear and reappear from the
|
||||
// trace, this occurs because we log only 1x per frame
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("CommonAssertions")
|
||||
package com.android.wm.shell.flicker.pip
|
||||
|
||||
internal const val PIP_WINDOW_COMPONENT = "PipMenuActivity"
|
||||
|
||||
@@ -26,7 +26,6 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.traces.parser.toLayerName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
@@ -29,7 +29,7 @@ import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_PORTRAIT
|
||||
@@ -106,7 +106,7 @@ class EnterPipToOtherOrientationTest(
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [WindowManagerStateHelper.NAV_BAR_COMPONENT] has the correct position at
|
||||
* Checks that the [FlickerComponentName.NAV_BAR] has the correct position at
|
||||
* the start and end of the transition
|
||||
*/
|
||||
@FlakyTest
|
||||
@@ -115,7 +115,7 @@ class EnterPipToOtherOrientationTest(
|
||||
testSpec.navBarLayerRotatesAndScales(Surface.ROTATION_90, Surface.ROTATION_0)
|
||||
|
||||
/**
|
||||
* Checks that the [WindowManagerStateHelper.STATUS_BAR_COMPONENT] has the correct position at
|
||||
* Checks that the [FlickerComponentName.STATUS_BAR] has the correct position at
|
||||
* the start and end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@@ -150,7 +150,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun testAppWindowInvisibleOnStart() {
|
||||
testSpec.assertWmStart {
|
||||
isInvisible(testApp.component)
|
||||
isAppWindowInvisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ class EnterPipToOtherOrientationTest(
|
||||
@Test
|
||||
fun testAppWindowVisibleOnEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(testApp.component)
|
||||
isAppWindowVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.wm.shell.flicker.pip
|
||||
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.traces.parser.toLayerName
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import org.junit.Test
|
||||
|
||||
@@ -63,7 +62,7 @@ abstract class ExitPipToAppTransition(testSpec: FlickerTestParameter) : PipTrans
|
||||
// when the activity is STOPPING, sometimes it becomes invisible in an entry before
|
||||
// the window, sometimes in the same entry. This occurs because we log 1x per frame
|
||||
// thus we ignore activity here
|
||||
isAppWindowVisible(testApp.component, ignoreActivity = true)
|
||||
isAppWindowVisible(testApp.component)
|
||||
.isAppWindowOnTop(pipApp.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(testApp.component)
|
||||
|
||||
@@ -54,9 +54,9 @@ abstract class ExitPipTransition(testSpec: FlickerTestParameter) : PipTransition
|
||||
open fun pipWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.invoke("hasPipWindow") {
|
||||
it.isPinned(pipApp.component).isVisible(pipApp.component)
|
||||
it.isPinned(pipApp.component).isAppWindowVisible(pipApp.component)
|
||||
}.then().invoke("!hasPipWindow") {
|
||||
it.isNotPinned(pipApp.component).isInvisible(pipApp.component)
|
||||
it.isNotPinned(pipApp.component).isAppWindowInvisible(pipApp.component)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.traces.parser.toWindowName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
|
||||
@@ -23,7 +23,6 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.traces.parser.toWindowName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.traces.parser.toLayerName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
@@ -20,8 +20,6 @@ import android.platform.test.annotations.Presubmit
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.traces.RegionSubject
|
||||
import com.android.server.wm.traces.parser.toLayerName
|
||||
import com.android.server.wm.traces.parser.toWindowName
|
||||
import com.android.wm.shell.flicker.helpers.FixedAppHelper
|
||||
import org.junit.Test
|
||||
|
||||
|
||||
@@ -22,12 +22,12 @@ import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.wm.shell.flicker.helpers.ImeAppHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -43,7 +43,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group3
|
||||
@Group4
|
||||
class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
private val imeApp = ImeAppHelper(instrumentation)
|
||||
|
||||
@@ -90,7 +90,7 @@ class PipKeyboardTest(testSpec: FlickerTestParameter) : PipTransition(testSpec)
|
||||
@Test
|
||||
fun pipIsAboveAppWindow() {
|
||||
testSpec.assertWmTag(TAG_IME_VISIBLE) {
|
||||
isAboveWindow(WindowManagerStateHelper.IME_COMPONENT, pipApp.component)
|
||||
isAboveWindow(FlickerComponentName.IME, pipApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.launchSplitScreen
|
||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||
@@ -51,7 +51,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group3
|
||||
@Group4
|
||||
class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
private val imeApp = ImeAppHelper(instrumentation)
|
||||
private val testApp = FixedAppHelper(instrumentation)
|
||||
@@ -104,9 +104,9 @@ class PipLegacySplitScreenTest(testSpec: FlickerTestParameter) : PipTransition(t
|
||||
@Test
|
||||
fun bothAppWindowsVisible() {
|
||||
testSpec.assertWmEnd {
|
||||
isVisible(testApp.component)
|
||||
isVisible(imeApp.component)
|
||||
noWindowsOverlap(testApp.component, imeApp.component)
|
||||
isAppWindowVisible(testApp.component)
|
||||
isAppWindowVisible(imeApp.component)
|
||||
doNotOverlap(testApp.component, imeApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
@@ -62,7 +62,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group3
|
||||
@Group4
|
||||
class PipRotationTest(testSpec: FlickerTestParameter) : PipTransition(testSpec) {
|
||||
private val fixedApp = FixedAppHelper(instrumentation)
|
||||
private val screenBoundsStart = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
|
||||
@@ -22,7 +22,7 @@ import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.wm.shell.flicker.pip.PipTransition.BroadcastActionTrigger.Companion.ORIENTATION_LANDSCAPE
|
||||
@@ -43,7 +43,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group3
|
||||
@Group4
|
||||
class SetRequestedOrientationWhilePinnedTest(
|
||||
testSpec: FlickerTestParameter
|
||||
) : PipTransition(testSpec) {
|
||||
|
||||
@@ -28,6 +28,8 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMAR
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||
import static android.app.WindowConfiguration.activityTypeToString;
|
||||
import static android.app.WindowConfiguration.windowingModeToString;
|
||||
import static android.app.WindowConfigurationProto.WINDOWING_MODE;
|
||||
import static android.content.ConfigurationProto.WINDOW_CONFIGURATION;
|
||||
|
||||
import static com.android.server.wm.ConfigurationContainerProto.FULL_CONFIGURATION;
|
||||
import static com.android.server.wm.ConfigurationContainerProto.MERGED_OVERRIDE_CONFIGURATION;
|
||||
@@ -695,22 +697,40 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
|
||||
@CallSuper
|
||||
protected void dumpDebug(ProtoOutputStream proto, long fieldId,
|
||||
@WindowTraceLogLevel int logLevel) {
|
||||
// Critical log level logs only visible elements to mitigate performance overheard
|
||||
if (logLevel != WindowTraceLogLevel.ALL && !mHasOverrideConfiguration) {
|
||||
return;
|
||||
final long token = proto.start(fieldId);
|
||||
|
||||
if (logLevel == WindowTraceLogLevel.ALL || mHasOverrideConfiguration) {
|
||||
mRequestedOverrideConfiguration.dumpDebug(proto, OVERRIDE_CONFIGURATION,
|
||||
logLevel == WindowTraceLogLevel.CRITICAL);
|
||||
}
|
||||
|
||||
final long token = proto.start(fieldId);
|
||||
mRequestedOverrideConfiguration.dumpDebug(proto, OVERRIDE_CONFIGURATION,
|
||||
logLevel == WindowTraceLogLevel.CRITICAL);
|
||||
// Unless trace level is set to `WindowTraceLogLevel.ALL` don't dump anything that isn't
|
||||
// required to mitigate performance overhead
|
||||
if (logLevel == WindowTraceLogLevel.ALL) {
|
||||
mFullConfiguration.dumpDebug(proto, FULL_CONFIGURATION, false /* critical */);
|
||||
mMergedOverrideConfiguration.dumpDebug(proto, MERGED_OVERRIDE_CONFIGURATION,
|
||||
false /* critical */);
|
||||
}
|
||||
|
||||
if (logLevel == WindowTraceLogLevel.TRIM) {
|
||||
// Required for Fass to automatically detect pip transitions in Winscope traces
|
||||
dumpDebugWindowingMode(proto);
|
||||
}
|
||||
|
||||
proto.end(token);
|
||||
}
|
||||
|
||||
private void dumpDebugWindowingMode(ProtoOutputStream proto) {
|
||||
final long fullConfigToken = proto.start(FULL_CONFIGURATION);
|
||||
final long windowConfigToken = proto.start(WINDOW_CONFIGURATION);
|
||||
|
||||
int windowingMode = mFullConfiguration.windowConfiguration.getWindowingMode();
|
||||
proto.write(WINDOWING_MODE, windowingMode);
|
||||
|
||||
proto.end(windowConfigToken);
|
||||
proto.end(fullConfigToken);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps the names of this container children in the input print writer indenting each
|
||||
* level with the input prefix.
|
||||
|
||||
@@ -57,6 +57,7 @@ import static com.android.server.wm.WindowContainerProto.CONFIGURATION_CONTAINER
|
||||
import static com.android.server.wm.WindowContainerProto.IDENTIFIER;
|
||||
import static com.android.server.wm.WindowContainerProto.ORIENTATION;
|
||||
import static com.android.server.wm.WindowContainerProto.SURFACE_ANIMATOR;
|
||||
import static com.android.server.wm.WindowContainerProto.SURFACE_CONTROL;
|
||||
import static com.android.server.wm.WindowContainerProto.VISIBLE;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
|
||||
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
|
||||
@@ -2429,6 +2430,9 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
|
||||
if (mSurfaceAnimator.isAnimating()) {
|
||||
mSurfaceAnimator.dumpDebug(proto, SURFACE_ANIMATOR);
|
||||
}
|
||||
if (mSurfaceControl != null) {
|
||||
mSurfaceControl.dumpDebug(proto, SURFACE_CONTROL);
|
||||
}
|
||||
|
||||
// add children to proto
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
|
||||
@@ -17,22 +17,29 @@
|
||||
@file:JvmName("CommonAssertions")
|
||||
package com.android.server.wm.flicker
|
||||
|
||||
import android.content.ComponentName
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
|
||||
val LAUNCHER_COMPONENT = ComponentName("com.google.android.apps.nexuslauncher",
|
||||
val LAUNCHER_COMPONENT = FlickerComponentName("com.google.android.apps.nexuslauncher",
|
||||
"com.google.android.apps.nexuslauncher.NexusLauncherActivity")
|
||||
|
||||
/**
|
||||
* Checks that [FlickerComponentName.STATUS_BAR] window is visible and above the app windows in
|
||||
* all WM trace entries
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarWindowIsVisible() {
|
||||
assertWm {
|
||||
this.isAboveAppWindowVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
this.isAboveAppWindowVisible(FlickerComponentName.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [FlickerComponentName.NAV_BAR] window is visible and above the app windows in
|
||||
* all WM trace entries
|
||||
*/
|
||||
fun FlickerTestParameter.navBarWindowIsVisible() {
|
||||
assertWm {
|
||||
this.isAboveAppWindowVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
this.isAboveAppWindowVisible(FlickerComponentName.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,21 +76,29 @@ fun FlickerTestParameter.entireScreenCovered(allStates: Boolean = true) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [FlickerComponentName.NAV_BAR] layer is visible at the start and end of the SF
|
||||
* trace
|
||||
*/
|
||||
fun FlickerTestParameter.navBarLayerIsVisible() {
|
||||
assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.NAV_BAR)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [FlickerComponentName.STATUS_BAR] layer is visible at the start and end of the SF
|
||||
* trace
|
||||
*/
|
||||
fun FlickerTestParameter.statusBarLayerIsVisible() {
|
||||
assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.STATUS_BAR)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +111,10 @@ fun FlickerTestParameter.navBarLayerRotatesAndScales(
|
||||
val endingPos = WindowUtils.getNavigationBarPosition(endRotation)
|
||||
|
||||
assertLayersStart {
|
||||
this.visibleRegion(WindowManagerStateHelper.NAV_BAR_COMPONENT).coversExactly(startingPos)
|
||||
this.visibleRegion(FlickerComponentName.NAV_BAR).coversExactly(startingPos)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.visibleRegion(WindowManagerStateHelper.NAV_BAR_COMPONENT).coversExactly(endingPos)
|
||||
this.visibleRegion(FlickerComponentName.NAV_BAR).coversExactly(endingPos)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,10 +127,10 @@ fun FlickerTestParameter.statusBarLayerRotatesScales(
|
||||
val endingPos = WindowUtils.getStatusBarPosition(endRotation)
|
||||
|
||||
assertLayersStart {
|
||||
this.visibleRegion(WindowManagerStateHelper.STATUS_BAR_COMPONENT).coversExactly(startingPos)
|
||||
this.visibleRegion(FlickerComponentName.STATUS_BAR).coversExactly(startingPos)
|
||||
}
|
||||
assertLayersEnd {
|
||||
this.visibleRegion(WindowManagerStateHelper.STATUS_BAR_COMPONENT).coversExactly(endingPos)
|
||||
this.visibleRegion(FlickerComponentName.STATUS_BAR).coversExactly(endingPos)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,15 +147,15 @@ fun FlickerTestParameter.statusBarLayerRotatesScales(
|
||||
* (useful mostly for app launch)
|
||||
*/
|
||||
fun FlickerTestParameter.replacesLayer(
|
||||
originalLayer: ComponentName,
|
||||
newLayer: ComponentName,
|
||||
originalLayer: FlickerComponentName,
|
||||
newLayer: FlickerComponentName,
|
||||
ignoreSnapshot: Boolean = false
|
||||
) {
|
||||
assertLayers {
|
||||
val assertion = this.isVisible(originalLayer)
|
||||
if (ignoreSnapshot) {
|
||||
assertion.then()
|
||||
.isVisible(WindowManagerStateHelper.SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.isVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
}
|
||||
assertion.then().isVisible(newLayer)
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -33,13 +33,38 @@ import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test app closes by pressing back button
|
||||
*
|
||||
* To run this test: `atest FlickerTests:CloseAppBackButtonTest`
|
||||
*
|
||||
* Actions:
|
||||
* Make sure no apps are running on the device
|
||||
* Launch an app [testApp] and wait animation to complete
|
||||
* Press back button
|
||||
*
|
||||
* To run only the presubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Presubmit`
|
||||
*
|
||||
* To run only the postsubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Postsubmit`
|
||||
*
|
||||
* To run only the flaky assertions add: `--
|
||||
* --module-arg FlickerTests:include-annotation:androidx.test.filters.FlakyTest`
|
||||
*
|
||||
* Notes:
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [CloseAppTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
@Group4
|
||||
class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
@@ -50,14 +75,23 @@ class CloseAppBackButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): List<FlickerTestParameter> {
|
||||
|
||||
@@ -22,7 +22,7 @@ import androidx.test.filters.RequiresDevice
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -31,14 +31,39 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test app closes by pressing home button.
|
||||
* Test app closes by pressing home button
|
||||
*
|
||||
* To run this test: `atest FlickerTests:CloseAppHomeButtonTest`
|
||||
*
|
||||
* Actions:
|
||||
* Make sure no apps are running on the device
|
||||
* Launch an app [testApp] and wait animation to complete
|
||||
* Press home button
|
||||
*
|
||||
* To run only the presubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Presubmit`
|
||||
*
|
||||
* To run only the postsubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Postsubmit`
|
||||
*
|
||||
* To run only the flaky assertions add: `--
|
||||
* --module-arg FlickerTests:include-annotation:androidx.test.filters.FlakyTest`
|
||||
*
|
||||
* Notes:
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [CloseAppTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
@Group4
|
||||
class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransition(testSpec) {
|
||||
override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
|
||||
get() = {
|
||||
@@ -49,14 +74,23 @@ class CloseAppHomeButtonTest(testSpec: FlickerTestParameter) : CloseAppTransitio
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Postsubmit
|
||||
@Test
|
||||
override fun navBarLayerIsVisible() = super.navBarLayerIsVisible()
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
|
||||
@@ -62,6 +62,10 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point for the test runner. It will use this method to initialize and cache
|
||||
* flicker executions
|
||||
*/
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
@@ -69,42 +73,64 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the navigation bar window is visible during the whole transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsVisible() {
|
||||
testSpec.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the status bar window is visible during the whole transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarWindowIsVisible() {
|
||||
testSpec.statusBarWindowIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the navigation bar layer is visible during the whole transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsVisible() {
|
||||
testSpec.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the status bar layer is visible during the whole transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerIsVisible() {
|
||||
testSpec.statusBarLayerIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the position of the navigation bar at the start and end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerRotatesAndScales() {
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the position of the status bar at the start and end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun statusBarLayerRotatesScales() {
|
||||
testSpec.statusBarLayerRotatesScales(testSpec.config.startRotation, Surface.ROTATION_0)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that all windows that are visible on the trace, are visible for at least 2
|
||||
* consecutive entries.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
@@ -113,6 +139,10 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that all layers that are visible on the trace, are visible for at least 2
|
||||
* consecutive entries.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
@@ -121,10 +151,17 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that all parts of the screen are covered during the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun entireScreenCovered() = testSpec.entireScreenCovered()
|
||||
|
||||
/**
|
||||
* Checks that [testApp] is the top visible app window at the start of the transition and
|
||||
* that it is replaced by [LAUNCHER_COMPONENT] during the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherReplacesAppWindowAsTopWindow() {
|
||||
@@ -135,19 +172,26 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [LAUNCHER_COMPONENT] is invisible at the start of the transition and that
|
||||
* it becomes visible during the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherWindowBecomesVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(LAUNCHER_COMPONENT)
|
||||
this.isAppWindowNotOnTop(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [LAUNCHER_COMPONENT] layer becomes visible when [testApp] becomes invisible
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun launcherLayerReplacesApp() {
|
||||
testSpec.replacesLayer(testApp.component, LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:JvmName("FlickerExtensions")
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import com.android.server.wm.flicker.Flicker
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
class ImeAppAutoFocusHelper @JvmOverloads constructor(
|
||||
@@ -27,7 +28,8 @@ class ImeAppAutoFocusHelper @JvmOverloads constructor(
|
||||
private val rotation: Int,
|
||||
private val imePackageName: String = IME_PACKAGE,
|
||||
launcherName: String = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_LAUNCHER_NAME,
|
||||
component: ComponentName = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME
|
||||
component: FlickerComponentName =
|
||||
ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent()
|
||||
) : ImeAppHelper(instr, launcherName, component) {
|
||||
override fun openIME(
|
||||
device: UiDevice,
|
||||
|
||||
@@ -17,19 +17,21 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
open class ImeAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.IME_ACTIVITY_LAUNCHER_NAME,
|
||||
component: ComponentName = ActivityOptions.IME_ACTIVITY_COMPONENT_NAME,
|
||||
component: FlickerComponentName =
|
||||
ActivityOptions.IME_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
|
||||
@@ -17,15 +17,17 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class NonResizeableAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.NON_RESIZEABLE_ACTIVITY_LAUNCHER_NAME,
|
||||
component: ComponentName = ActivityOptions.NON_RESIZEABLE_ACTIVITY_COMPONENT_NAME,
|
||||
component: FlickerComponentName =
|
||||
ActivityOptions.NON_RESIZEABLE_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
|
||||
@@ -17,15 +17,17 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class SeamlessRotationAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.SEAMLESS_ACTIVITY_LAUNCHER_NAME,
|
||||
component: ComponentName = ActivityOptions.SEAMLESS_ACTIVITY_COMPONENT_NAME,
|
||||
component: FlickerComponentName =
|
||||
ActivityOptions.SEAMLESS_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
|
||||
@@ -17,15 +17,17 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
|
||||
class SimpleAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.SIMPLE_ACTIVITY_LAUNCHER_NAME,
|
||||
component: ComponentName = ActivityOptions.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME,
|
||||
component: FlickerComponentName =
|
||||
ActivityOptions.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
|
||||
@@ -17,19 +17,21 @@
|
||||
package com.android.server.wm.flicker.helpers
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.support.test.launcherhelper.ILauncherStrategy
|
||||
import android.support.test.launcherhelper.LauncherStrategyFactory
|
||||
import androidx.test.uiautomator.By
|
||||
import androidx.test.uiautomator.UiDevice
|
||||
import androidx.test.uiautomator.Until
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
|
||||
class TwoActivitiesAppHelper @JvmOverloads constructor(
|
||||
instr: Instrumentation,
|
||||
launcherName: String = ActivityOptions.BUTTON_ACTIVITY_LAUNCHER_NAME,
|
||||
component: ComponentName = ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME,
|
||||
component: FlickerComponentName =
|
||||
ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME.toFlickerComponent(),
|
||||
launcherStrategy: ILauncherStrategy = LauncherStrategyFactory
|
||||
.getInstance(instr)
|
||||
.launcherStrategy
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -125,7 +125,7 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ class CloseImeAutoOpenWindowToAppTest(private val testSpec: FlickerTestParameter
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isInvisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -110,7 +110,7 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(testApp.component)
|
||||
.then()
|
||||
.appWindowNotOnTop(testApp.component)
|
||||
.isAppWindowNotOnTop(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
@Test
|
||||
fun imeLayerVisibleStart() {
|
||||
testSpec.assertLayersStart {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
@Test
|
||||
fun imeLayerInvisibleEnd() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isInvisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,8 +173,8 @@ class CloseImeAutoOpenWindowToHomeTest(private val testSpec: FlickerTestParamete
|
||||
fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT))
|
||||
FlickerComponentName.IME,
|
||||
FlickerComponentName.SPLASH_SCREEN))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Assume
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -91,9 +91,9 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT))
|
||||
FlickerComponentName.IME,
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,4 +165,4 @@ class CloseImeWindowToAppTest(private val testSpec: FlickerTestParameter) {
|
||||
.getConfigNonRotationTests(repetitions = 5)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,7 +37,7 @@ import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -95,9 +95,9 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT))
|
||||
FlickerComponentName.IME,
|
||||
FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,8 +157,8 @@ class CloseImeWindowToHomeTest(private val testSpec: FlickerTestParameter) {
|
||||
fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(listOf(
|
||||
WindowManagerStateHelper.IME_COMPONENT,
|
||||
WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT))
|
||||
FlickerComponentName.IME,
|
||||
FlickerComponentName.SPLASH_SCREEN))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,52 +18,52 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesVisible() {
|
||||
assertLayers {
|
||||
this.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isInvisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeLayerBecomesInvisible() {
|
||||
assertLayers {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isInvisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowIsAlwaysVisible(rotatesScreen: Boolean = false) {
|
||||
if (rotatesScreen) {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isNonAppWindowVisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isNonAppWindowInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isNonAppWindowInvisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isNonAppWindowVisible(FlickerComponentName.IME)
|
||||
}
|
||||
} else {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isNonAppWindowVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesVisible() {
|
||||
assertWm {
|
||||
this.isNonAppWindowInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isNonAppWindowInvisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isNonAppWindowVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
fun FlickerTestParameter.imeWindowBecomesInvisible() {
|
||||
assertWm {
|
||||
this.isNonAppWindowVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isNonAppWindowVisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isNonAppWindowInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isNonAppWindowInvisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import android.app.Instrumentation
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.filters.FlakyTest
|
||||
import androidx.test.filters.RequiresDevice
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
@@ -142,7 +143,7 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
}
|
||||
}
|
||||
|
||||
@Presubmit
|
||||
@FlakyTest
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertWm {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.os.SystemProperties
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
@@ -43,7 +42,7 @@ import com.android.server.wm.flicker.endRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Assume
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -104,12 +103,12 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
@Presubmit
|
||||
@Test
|
||||
fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
val component = ComponentName("", "RecentTaskScreenshotSurface")
|
||||
val component = FlickerComponentName("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertWm {
|
||||
this.visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||
ignoreWindows = listOf(WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
component)
|
||||
ignoreWindows = listOf(FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT,
|
||||
component)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -138,9 +137,9 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
// Since we log 1x per frame, sometimes the activity visibility and the app visibility
|
||||
// are updated together, sometimes not, thus ignore activity check at the start
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp.component, ignoreActivity = true)
|
||||
this.isAppWindowVisible(testApp.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(testApp.component, ignoreActivity = true)
|
||||
.isAppWindowInvisible(testApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp.component)
|
||||
}
|
||||
@@ -155,7 +154,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
// and the app visibility are updated together, sometimes not, thus ignore activity
|
||||
// check at the start
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp.component, ignoreActivity = true)
|
||||
this.isAppWindowVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,11 +176,11 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
fun imeLayerIsBecomesVisibleLegacy() {
|
||||
Assume.assumeFalse(isShellTransitionsEnabled)
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isInvisible(FlickerComponentName.IME)
|
||||
.then()
|
||||
.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
.isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +189,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
fun imeLayerIsBecomesVisible() {
|
||||
Assume.assumeTrue(isShellTransitionsEnabled)
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +199,7 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(WindowManagerStateHelper.SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.isVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp.component)
|
||||
}
|
||||
@@ -223,11 +222,11 @@ class ReOpenImeWindowTest(private val testSpec: FlickerTestParameter) {
|
||||
fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
// depends on how much of the animation transactions are sent to SF at once
|
||||
// sometimes this layer appears for 2-3 frames, sometimes for only 1
|
||||
val recentTaskComponent = ComponentName("", "RecentTaskScreenshotSurface")
|
||||
val recentTaskComponent = FlickerComponentName("", "RecentTaskScreenshotSurface")
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT, recentTaskComponent)
|
||||
listOf(FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT, recentTaskComponent)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.server.wm.flicker.ime
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
@@ -28,7 +27,7 @@ import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group2
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
@@ -36,7 +35,7 @@ import com.android.server.wm.flicker.helpers.setRotation
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -52,7 +51,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group2
|
||||
@Group4
|
||||
@Presubmit
|
||||
class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParameter) {
|
||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
@@ -107,51 +106,52 @@ class SwitchImeWindowsFromGestureNavTest(private val testSpec: FlickerTestParame
|
||||
|
||||
@Test
|
||||
fun imeAppWindowVisibility() {
|
||||
val component = ComponentName(imeTestApp.`package`, "")
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(component)
|
||||
.then()
|
||||
.isAppWindowVisible(component, ignoreActivity = true)
|
||||
isAppWindowVisible(imeTestApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(imeTestApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun navBarLayerIsVisibleAroundSwitching() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
isVisible(FlickerComponentName.NAV_BAR)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
isVisible(FlickerComponentName.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun statusBarLayerIsVisibleAroundSwitching() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
isVisible(FlickerComponentName.STATUS_BAR)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
isVisible(FlickerComponentName.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun imeLayerIsVisibleWhenSwitchingToImeApp() {
|
||||
testSpec.assertLayersStart {
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
testSpec.assertLayersTag(TAG_IME_VISIBLE) {
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
testSpec.assertLayersEnd {
|
||||
isVisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
isVisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun imeLayerIsInvisibleWhenSwitchingToTestApp() {
|
||||
testSpec.assertLayersTag(TAG_IME_INVISIBLE) {
|
||||
isInvisible(WindowManagerStateHelper.IME_COMPONENT)
|
||||
isInvisible(FlickerComponentName.IME)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,11 @@ import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.TwoActivitiesAppHelper
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.parser.toFlickerComponent
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -39,17 +40,33 @@ import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test the back and forward transition between 2 activities.
|
||||
*
|
||||
* To run this test: `atest FlickerTests:ActivitiesTransitionTest`
|
||||
*
|
||||
* Actions:
|
||||
* Launch an app
|
||||
* Launch a secondary activity within the app
|
||||
* Close the secondary activity back to the initial one
|
||||
*
|
||||
* Notes:
|
||||
* 1. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
@Group4
|
||||
class ActivitiesTransitionTest(val testSpec: FlickerTestParameter) {
|
||||
val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
private val testApp: TwoActivitiesAppHelper = TwoActivitiesAppHelper(instrumentation)
|
||||
|
||||
/**
|
||||
* Entry point for the test runner. It will use this method to initialize and cache
|
||||
* flicker executions
|
||||
*/
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
@@ -75,30 +92,52 @@ class ActivitiesTransitionTest(val testSpec: FlickerTestParameter) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME] activity is visible at
|
||||
* the start of the transition, that
|
||||
* [ActivityOptions.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME] becomes visible during the
|
||||
* transition, and that [ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME] is again visible
|
||||
* at the end
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun finishSubActivity() {
|
||||
val buttonActivityComponent = ActivityOptions
|
||||
.BUTTON_ACTIVITY_COMPONENT_NAME.toFlickerComponent()
|
||||
val imeAutoFocusActivityComponent = ActivityOptions
|
||||
.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME.toFlickerComponent()
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME)
|
||||
.then()
|
||||
.isAppWindowOnTop(ActivityOptions.SIMPLE_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME)
|
||||
.then()
|
||||
.isAppWindowOnTop(ActivityOptions.BUTTON_ACTIVITY_COMPONENT_NAME)
|
||||
this.isAppWindowOnTop(buttonActivityComponent)
|
||||
.then()
|
||||
.isAppWindowOnTop(imeAutoFocusActivityComponent)
|
||||
.then()
|
||||
.isAppWindowOnTop(buttonActivityComponent)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that all parts of the screen are covered during the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun entireScreenCovered() = testSpec.entireScreenCovered()
|
||||
|
||||
/**
|
||||
* Checks that the [LAUNCHER_COMPONENT] window is not on top. The launcher cannot be
|
||||
* asserted with `isAppWindowVisible` because it contains 2 windows with the exact same name,
|
||||
* and both are never simultaneously visible
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherWindowNotVisible() {
|
||||
fun launcherWindowNotOnTop() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(LAUNCHER_COMPONENT, ignoreActivity = true)
|
||||
this.isAppWindowNotOnTop(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [LAUNCHER_COMPONENT] layer is never visible during the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun launcherLayerNotVisible() {
|
||||
@@ -106,6 +145,12 @@ class ActivitiesTransitionTest(val testSpec: FlickerTestParameter) {
|
||||
}
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigNonRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.android.server.wm.flicker.launch
|
||||
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import android.view.Surface
|
||||
@@ -29,7 +28,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import com.google.common.truth.Truth
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
@@ -61,7 +60,7 @@ import org.junit.runners.Parameterized
|
||||
@Group1
|
||||
class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : OpenAppTransition(testSpec) {
|
||||
override val testApp = NonResizeableAppHelper(instrumentation)
|
||||
private val colorFadComponent = ComponentName("", "ColorFade BLAST#")
|
||||
private val colorFadComponent = FlickerComponentName("", "ColorFade BLAST#")
|
||||
|
||||
/**
|
||||
* Defines the transition used to run the test
|
||||
@@ -92,15 +91,15 @@ class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : OpenAppTransiti
|
||||
* Checks that the nav bar layer starts visible, becomes invisible during unlocking animation
|
||||
* and becomes visible at the end
|
||||
*/
|
||||
@Presubmit
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun navBarLayerVisibilityChanges() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
this.isVisible(FlickerComponentName.NAV_BAR)
|
||||
.then()
|
||||
.isInvisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
.isInvisible(FlickerComponentName.NAV_BAR)
|
||||
.then()
|
||||
.isVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
.isVisible(FlickerComponentName.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,10 +132,9 @@ class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : OpenAppTransiti
|
||||
testSpec.assertWm {
|
||||
this.notContains(testApp.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(testApp.component,
|
||||
ignoreActivity = true, isOptional = true)
|
||||
.isAppWindowInvisible(testApp.component, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp.component, ignoreActivity = true)
|
||||
.isAppWindowVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +145,7 @@ class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : OpenAppTransiti
|
||||
@Test
|
||||
fun appWindowBecomesVisibleAtEnd() {
|
||||
testSpec.assertWmEnd {
|
||||
this.isVisible(testApp.component)
|
||||
this.isAppWindowVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,11 +157,11 @@ class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : OpenAppTransiti
|
||||
@Test
|
||||
fun navBarWindowsVisibilityChanges() {
|
||||
testSpec.assertWm {
|
||||
this.isAboveAppWindowVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
this.isAboveAppWindowVisible(FlickerComponentName.NAV_BAR)
|
||||
.then()
|
||||
.isNonAppWindowInvisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
.isNonAppWindowInvisible(FlickerComponentName.NAV_BAR)
|
||||
.then()
|
||||
.isAboveAppWindowVisible(WindowManagerStateHelper.NAV_BAR_COMPONENT)
|
||||
.isAboveAppWindowVisible(FlickerComponentName.NAV_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,6 +171,10 @@ class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) : OpenAppTransiti
|
||||
override fun visibleWindowsShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
|
||||
@@ -39,10 +39,12 @@ import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.SNAPSHOT_COMPONENT
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.SPLASH_SCREEN_COMPONENT
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Base class for app launch tests
|
||||
*/
|
||||
abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
protected open val testApp: StandardAppHelper = SimpleAppHelper(instrumentation)
|
||||
@@ -85,7 +87,7 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the navigation bar layer is visible during the whole transition
|
||||
* Checks that the navigation bar layer is visible at the start and end of the trace
|
||||
*/
|
||||
open fun navBarLayerIsVisible() {
|
||||
testSpec.navBarLayerIsVisible()
|
||||
@@ -110,7 +112,7 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the status bar layer is visible during the whole transition
|
||||
* Checks that the status bar layer is visible at the start and end of the trace
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
@@ -188,9 +190,9 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowOnTop(SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.isAppWindowOnTop(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(SPLASH_SCREEN_COMPONENT, isOptional = true)
|
||||
.isAppWindowOnTop(FlickerComponentName.SPLASH_SCREEN, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowOnTop(testApp.component)
|
||||
}
|
||||
@@ -202,9 +204,9 @@ abstract class OpenAppTransition(protected val testSpec: FlickerTestParameter) {
|
||||
*/
|
||||
open fun launcherWindowBecomesInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(LAUNCHER_COMPONENT)
|
||||
this.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowInvisible(LAUNCHER_COMPONENT)
|
||||
.isAppWindowNotOnTop(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.SNAPSHOT_COMPONENT
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -189,9 +189,9 @@ class QuickSwitchBetweenTwoAppsBackTest(private val testSpec: FlickerTestParamet
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(testApp1.component)
|
||||
.then()
|
||||
.isAppWindowVisible(SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.isAppWindowVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp1.component, ignoreActivity = true)
|
||||
.isAppWindowVisible(testApp1.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ class QuickSwitchBetweenTwoAppsBackTest(private val testSpec: FlickerTestParamet
|
||||
@Test
|
||||
fun app2WindowBecomesAndStaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp2.component, ignoreActivity = true)
|
||||
this.isAppWindowVisible(testApp2.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(testApp2.component)
|
||||
}
|
||||
@@ -251,7 +251,7 @@ class QuickSwitchBetweenTwoAppsBackTest(private val testSpec: FlickerTestParamet
|
||||
// TODO: Do we actually want to test this? Seems too implementation specific...
|
||||
.isAppWindowVisible(LAUNCHER_COMPONENT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.isAppWindowVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp1.component)
|
||||
}
|
||||
@@ -270,7 +270,7 @@ class QuickSwitchBetweenTwoAppsBackTest(private val testSpec: FlickerTestParamet
|
||||
.then()
|
||||
.isVisible(LAUNCHER_COMPONENT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(SNAPSHOT_COMPONENT, isOptional = true)
|
||||
.isVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp1.component)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,348 @@
|
||||
/*
|
||||
* Copyright (C) 2021 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.server.wm.flicker.quickswitch
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.platform.test.annotations.Postsubmit
|
||||
import android.platform.test.annotations.RequiresDevice
|
||||
import android.view.Surface
|
||||
import android.view.WindowManagerPolicyConstants
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
import com.android.server.wm.flicker.helpers.WindowUtils
|
||||
import com.android.server.wm.flicker.helpers.isRotated
|
||||
import com.android.server.wm.flicker.navBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.repetitions
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Test quick switching back to previous app from last opened app
|
||||
*
|
||||
* To run this test: `atest FlickerTests:QuickSwitchBetweenTwoAppsBackTest`
|
||||
*
|
||||
* Actions:
|
||||
* Launch an app [testApp1]
|
||||
* Launch another app [testApp2]
|
||||
* Swipe right from the bottom of the screen to quick switch back to the first app [testApp1]
|
||||
* Swipe left from the bottom of the screen to quick switch forward to the second app [testApp2]
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
class QuickSwitchBetweenTwoAppsForwardTest(private val testSpec: FlickerTestParameter) {
|
||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
|
||||
private val testApp1 = SimpleAppHelper(instrumentation)
|
||||
private val testApp2 = NonResizeableAppHelper(instrumentation)
|
||||
|
||||
private val startDisplayBounds = WindowUtils.getDisplayBounds(testSpec.config.startRotation)
|
||||
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
withTestName { testSpec.name }
|
||||
repeat { testSpec.config.repetitions }
|
||||
setup {
|
||||
eachRun {
|
||||
testApp1.launchViaIntent(wmHelper)
|
||||
wmHelper.waitForFullScreenApp(testApp1.component)
|
||||
|
||||
testApp2.launchViaIntent(wmHelper)
|
||||
wmHelper.waitForFullScreenApp(testApp2.component)
|
||||
|
||||
// Swipe right from bottom to quick switch back
|
||||
// NOTE: We don't perform an edge-to-edge swipe but instead only swipe in the middle
|
||||
// as to not accidentally trigger a swipe back or forward action which would result
|
||||
// in the same behavior but not testing quick swap.
|
||||
device.swipe(
|
||||
startDisplayBounds.bounds.right / 3,
|
||||
startDisplayBounds.bounds.bottom,
|
||||
2 * startDisplayBounds.bounds.right / 3,
|
||||
startDisplayBounds.bounds.bottom,
|
||||
if (testSpec.config.startRotation.isRotated()) 75 else 30
|
||||
)
|
||||
|
||||
wmHelper.waitForFullScreenApp(testApp1.component)
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
}
|
||||
}
|
||||
transitions {
|
||||
// Swipe left from bottom to quick switch forward
|
||||
// NOTE: We don't perform an edge-to-edge swipe but instead only swipe in the middle
|
||||
// as to not accidentally trigger a swipe back or forward action which would result
|
||||
// in the same behavior but not testing quick swap.
|
||||
device.swipe(
|
||||
2 * startDisplayBounds.bounds.right / 3,
|
||||
startDisplayBounds.bounds.bottom,
|
||||
startDisplayBounds.bounds.right / 3,
|
||||
startDisplayBounds.bounds.bottom,
|
||||
if (testSpec.config.startRotation.isRotated()) 75 else 30
|
||||
)
|
||||
|
||||
wmHelper.waitForFullScreenApp(testApp2.component)
|
||||
wmHelper.waitForAppTransitionIdle()
|
||||
}
|
||||
|
||||
teardown {
|
||||
test {
|
||||
testApp1.exit()
|
||||
testApp2.exit()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the transition starts with [testApp1]'s windows filling/covering exactly the
|
||||
* entirety of the display.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun startsWithApp1WindowsCoverFullScreen() {
|
||||
testSpec.assertWmStart {
|
||||
this.frameRegion(testApp1.component).coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the transition starts with [testApp1]'s layers filling/covering exactly the
|
||||
* entirety of the display.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun startsWithApp1LayersCoverFullScreen() {
|
||||
testSpec.assertLayersStart {
|
||||
this.visibleRegion(testApp1.component).coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the transition starts with [testApp1] being the top window.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun startsWithApp1WindowBeingOnTop() {
|
||||
testSpec.assertWmStart {
|
||||
this.isAppWindowOnTop(testApp1.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp2] windows fill the entire screen (i.e. is "fullscreen") at the end of the
|
||||
* transition once we have fully quick switched from [testApp1] back to the [testApp2].
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun endsWithApp2WindowsCoveringFullScreen() {
|
||||
testSpec.assertWmEnd {
|
||||
this.frameRegion(testApp2.component).coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp2] layers fill the entire screen (i.e. is "fullscreen") at the end of the
|
||||
* transition once we have fully quick switched from [testApp1] back to the [testApp2].
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun endsWithApp2LayersCoveringFullScreen() {
|
||||
testSpec.assertLayersEnd {
|
||||
this.visibleRegion(testApp2.component).coversExactly(startDisplayBounds)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp2] is the top window at the end of the transition once we have fully quick
|
||||
* switched from [testApp1] back to the [testApp2].
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun endsWithApp2BeingOnTop() {
|
||||
testSpec.assertWmEnd {
|
||||
this.isAppWindowOnTop(testApp2.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp2]'s window starts off invisible and becomes visible at some point before
|
||||
* the end of the transition and then stays visible until the end of the transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun app2WindowBecomesAndStaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(testApp2.component)
|
||||
.then()
|
||||
.isAppWindowVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp2.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp2]'s layer starts off invisible and becomes visible at some point before
|
||||
* the end of the transition and then stays visible until the end of the transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun app2LayerBecomesAndStaysVisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(testApp2.component)
|
||||
.then()
|
||||
.isVisible(testApp2.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp1]'s window starts off visible and becomes invisible at some point before
|
||||
* the end of the transition and then stays invisible until the end of the transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun app1WindowBecomesAndStaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp1.component)
|
||||
.then()
|
||||
.isAppWindowInvisible(testApp1.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp1]'s layer starts off visible and becomes invisible at some point before
|
||||
* the end of the transition and then stays invisible until the end of the transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun app1LayerBecomesAndStaysInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp1.component)
|
||||
.then()
|
||||
.isInvisible(testApp1.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp1]'s window is visible at least until [testApp2]'s window is visible.
|
||||
* Ensures that at any point, either [testApp2] or [testApp1]'s windows are at least partially
|
||||
* visible.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun app2WindowIsVisibleOnceApp1WindowIsInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(testApp1.component)
|
||||
.then()
|
||||
.isAppWindowVisible(LAUNCHER_COMPONENT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp2.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp1]'s layer is visible at least until [testApp2]'s window is visible.
|
||||
* Ensures that at any point, either [testApp2] or [testApp1]'s windows are at least partially
|
||||
* visible.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun app2LayerIsVisibleOnceApp1LayerIsInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp1.component)
|
||||
.then()
|
||||
.isVisible(LAUNCHER_COMPONENT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(FlickerComponentName.SNAPSHOT, isOptional = true)
|
||||
.then()
|
||||
.isVisible(testApp2.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the navbar window is visible throughout the entire transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun navBarWindowIsAlwaysVisible() = testSpec.navBarWindowIsVisible()
|
||||
|
||||
/**
|
||||
* Checks that the navbar layer is visible throughout the entire transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun navBarLayerAlwaysIsVisible() = testSpec.navBarLayerIsVisible()
|
||||
|
||||
/**
|
||||
* Checks that the navbar is always in the right position and covers the expected region.
|
||||
*
|
||||
* NOTE: This doesn't check that the navbar is visible or not.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun navbarIsAlwaysInRightPosition() =
|
||||
testSpec.navBarLayerRotatesAndScales(testSpec.config.startRotation)
|
||||
|
||||
/**
|
||||
* Checks that the status bar window is visible throughout the entire transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysVisible() = testSpec.statusBarWindowIsVisible()
|
||||
|
||||
/**
|
||||
* Checks that the status bar layer is visible throughout the entire transition.
|
||||
*/
|
||||
@Postsubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysVisible() = testSpec.statusBarLayerIsVisible()
|
||||
|
||||
companion object {
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigNonRotationTests(
|
||||
repetitions = 5,
|
||||
supportedNavigationModes = listOf(
|
||||
WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY
|
||||
),
|
||||
supportedRotations = listOf(Surface.ROTATION_0, Surface.ROTATION_90)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.FlickerParametersRunnerFactory
|
||||
import com.android.server.wm.flicker.FlickerTestParameter
|
||||
import com.android.server.wm.flicker.FlickerTestParameterFactory
|
||||
import com.android.server.wm.flicker.LAUNCHER_COMPONENT
|
||||
import com.android.server.wm.flicker.annotation.Group1
|
||||
import com.android.server.wm.flicker.annotation.Group4
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.helpers.SimpleAppHelper
|
||||
@@ -38,7 +38,7 @@ import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.SNAPSHOT_COMPONENT
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -60,7 +60,7 @@ import org.junit.runners.Parameterized
|
||||
@RunWith(Parameterized::class)
|
||||
@Parameterized.UseParametersRunnerFactory(FlickerParametersRunnerFactory::class)
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@Group1
|
||||
@Group4
|
||||
class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
|
||||
private val testApp = SimpleAppHelper(instrumentation)
|
||||
@@ -145,7 +145,7 @@ class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
@Test
|
||||
fun startsWithHomeActivityFlaggedVisible() {
|
||||
testSpec.assertWmStart {
|
||||
this.isHomeActivityVisible(true)
|
||||
this.isHomeActivityVisible()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
@Test
|
||||
fun endsWithHomeActivityFlaggedInvisible() {
|
||||
testSpec.assertWmEnd {
|
||||
this.isHomeActivityVisible(false)
|
||||
this.isHomeActivityInvisible()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,9 +204,9 @@ class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
@Test
|
||||
fun appWindowBecomesAndStaysVisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowInvisible(testApp.component, ignoreActivity = true)
|
||||
this.isAppWindowInvisible(testApp.component)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp.component, ignoreActivity = true)
|
||||
.isAppWindowVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,9 +232,9 @@ class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
@Test
|
||||
fun launcherWindowBecomesAndStaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(LAUNCHER_COMPONENT)
|
||||
this.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowInvisible(LAUNCHER_COMPONENT)
|
||||
.isAppWindowNotOnTop(LAUNCHER_COMPONENT)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,9 +260,9 @@ class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
@Test
|
||||
fun appWindowIsVisibleOnceLauncherWindowIsInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAppWindowVisible(LAUNCHER_COMPONENT)
|
||||
this.isAppWindowOnTop(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isAppWindowVisible(SNAPSHOT_COMPONENT)
|
||||
.isAppWindowVisible(FlickerComponentName.SNAPSHOT)
|
||||
.then()
|
||||
.isAppWindowVisible(testApp.component)
|
||||
}
|
||||
@@ -278,7 +278,7 @@ class QuickSwitchFromLauncherTest(private val testSpec: FlickerTestParameter) {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(LAUNCHER_COMPONENT)
|
||||
.then()
|
||||
.isVisible(SNAPSHOT_COMPONENT)
|
||||
.isVisible(FlickerComponentName.SNAPSHOT)
|
||||
.then()
|
||||
.isVisible(testApp.component)
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.flicker.statusBarLayerIsVisible
|
||||
import com.android.server.wm.flicker.statusBarLayerRotatesScales
|
||||
import com.android.server.wm.flicker.statusBarWindowIsVisible
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.ROTATION_COMPONENT
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -38,8 +38,39 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Cycle through supported app rotations.
|
||||
* Test opening an app and cycling through app rotations
|
||||
*
|
||||
* Currently runs:
|
||||
* 0 -> 90 degrees
|
||||
* 90 -> 0 degrees
|
||||
*
|
||||
* Actions:
|
||||
* Launch an app (via intent)
|
||||
* Set initial device orientation
|
||||
* Start tracing
|
||||
* Change device orientation
|
||||
* Stop tracing
|
||||
*
|
||||
* To run this test: `atest FlickerTests:ChangeAppRotationTest`
|
||||
*
|
||||
* To run only the presubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Presubmit`
|
||||
*
|
||||
* To run only the postsubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Postsubmit`
|
||||
*
|
||||
* To run only the flaky assertions add: `--
|
||||
* --module-arg FlickerTests:include-annotation:androidx.test.filters.FlakyTest`
|
||||
*
|
||||
* Notes:
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [RotationTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@@ -60,36 +91,51 @@ class ChangeAppRotationTest(
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest(bugId = 190185577)
|
||||
@Test
|
||||
override fun focusDoesNotChange() {
|
||||
super.focusDoesNotChange()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [FlickerComponentName.ROTATION] layer appears during the transition,
|
||||
* doesn't flicker, and disappears before the transition is complete
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun screenshotLayerBecomesInvisible() {
|
||||
fun rotationLayerAppearsAndVanishes() {
|
||||
testSpec.assertLayers {
|
||||
this.isVisible(testApp.component)
|
||||
.then()
|
||||
.isVisible(ROTATION_COMPONENT)
|
||||
.isVisible(FlickerComponentName.ROTATION)
|
||||
.then()
|
||||
.isVisible(testApp.component)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the status bar window is visible and above the app windows in all WM
|
||||
* trace entries
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsVisible() {
|
||||
testSpec.statusBarWindowIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the status bar layer is visible at the start and end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsVisible() {
|
||||
testSpec.statusBarLayerIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the position of the status bar at the start and end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerRotatesScales() {
|
||||
@@ -97,13 +143,26 @@ class ChangeAppRotationTest(
|
||||
testSpec.config.startRotation, testSpec.config.endRotation)
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() {
|
||||
super.navBarLayerRotatesAndScales()
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun visibleLayersShownMoreThanOneConsecutiveEntry() =
|
||||
super.visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.server.wm.flicker.rotation
|
||||
|
||||
import android.app.Instrumentation
|
||||
import android.content.ComponentName
|
||||
import android.platform.test.annotations.Presubmit
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import com.android.server.wm.flicker.FlickerBuilderProvider
|
||||
@@ -31,9 +30,12 @@ import com.android.server.wm.flicker.navBarLayerRotatesAndScales
|
||||
import com.android.server.wm.flicker.navBarWindowIsVisible
|
||||
import com.android.server.wm.flicker.entireScreenCovered
|
||||
import com.android.server.wm.flicker.startRotation
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.Test
|
||||
|
||||
/**
|
||||
* Base class for app rotation tests
|
||||
*/
|
||||
abstract class RotationTransition(protected val testSpec: FlickerTestParameter) {
|
||||
protected abstract val testApp: StandardAppHelper
|
||||
|
||||
@@ -55,6 +57,10 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point for the test runner. It will use this method to initialize and cache
|
||||
* flicker executions
|
||||
*/
|
||||
@FlickerBuilderProvider
|
||||
fun buildFlicker(): FlickerBuilder {
|
||||
return FlickerBuilder(instrumentation).apply {
|
||||
@@ -62,18 +68,28 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the navigation bar window is visible and above the app windows in all WM
|
||||
* trace entries
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarWindowIsVisible() {
|
||||
testSpec.navBarWindowIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the navigation bar layer is visible at the start and end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerIsVisible() {
|
||||
testSpec.navBarLayerIsVisible()
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the position of the navigation bar at the start and end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun navBarLayerRotatesAndScales() {
|
||||
@@ -81,19 +97,27 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
testSpec.config.startRotation, testSpec.config.endRotation)
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that all layers that are visible on the trace, are visible for at least 2
|
||||
* consecutive entries.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleLayersShownMoreThanOneConsecutiveEntry() {
|
||||
testSpec.assertLayers {
|
||||
this.visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
ignoreLayers = listOf(WindowManagerStateHelper.SPLASH_SCREEN_COMPONENT,
|
||||
WindowManagerStateHelper.SNAPSHOT_COMPONENT,
|
||||
ComponentName("", "SecondaryHomeHandle")
|
||||
ignoreLayers = listOf(FlickerComponentName.SPLASH_SCREEN,
|
||||
FlickerComponentName.SNAPSHOT,
|
||||
FlickerComponentName("", "SecondaryHomeHandle")
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that all windows that are visible on the trace, are visible for at least 2
|
||||
* consecutive entries.
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun visibleWindowsShownMoreThanOneConsecutiveEntry() {
|
||||
@@ -102,10 +126,16 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that all parts of the screen are covered during the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun entireScreenCovered() = testSpec.entireScreenCovered()
|
||||
|
||||
/**
|
||||
* Checks that the focus doesn't change during animation
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun focusDoesNotChange() {
|
||||
@@ -114,6 +144,9 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] layer covers the entire screen at the start of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appLayerRotates_StartingPos() {
|
||||
@@ -124,6 +157,9 @@ abstract class RotationTransition(protected val testSpec: FlickerTestParameter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] layer covers the entire screen at the end of the transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
open fun appLayerRotates_EndingPos() {
|
||||
|
||||
@@ -27,7 +27,7 @@ import com.android.server.wm.flicker.annotation.Group3
|
||||
import com.android.server.wm.flicker.dsl.FlickerBuilder
|
||||
import com.android.server.wm.flicker.helpers.SeamlessRotationAppHelper
|
||||
import com.android.server.wm.flicker.testapp.ActivityOptions
|
||||
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
|
||||
import com.android.server.wm.traces.common.FlickerComponentName
|
||||
import org.junit.FixMethodOrder
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -35,8 +35,41 @@ import org.junit.runners.MethodSorters
|
||||
import org.junit.runners.Parameterized
|
||||
|
||||
/**
|
||||
* Cycle through supported app rotations using seamless rotations.
|
||||
* Test opening an app and cycling through app rotations using seamless rotations
|
||||
*
|
||||
* Currently runs:
|
||||
* 0 -> 90 degrees
|
||||
* 0 -> 90 degrees (with starved UI thread)
|
||||
* 90 -> 0 degrees
|
||||
* 90 -> 0 degrees (with starved UI thread)
|
||||
*
|
||||
* Actions:
|
||||
* Launch an app in fullscreen and supporting seamless rotation (via intent)
|
||||
* Set initial device orientation
|
||||
* Start tracing
|
||||
* Change device orientation
|
||||
* Stop tracing
|
||||
*
|
||||
* To run this test: `atest FlickerTests:SeamlessAppRotationTest`
|
||||
*
|
||||
* To run only the presubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Presubmit`
|
||||
*
|
||||
* To run only the postsubmit assertions add: `--
|
||||
* --module-arg FlickerTests:exclude-annotation:androidx.test.filters.FlakyTest
|
||||
* --module-arg FlickerTests:include-annotation:android.platform.test.annotations.Postsubmit`
|
||||
*
|
||||
* To run only the flaky assertions add: `--
|
||||
* --module-arg FlickerTests:include-annotation:androidx.test.filters.FlakyTest`
|
||||
*
|
||||
* Notes:
|
||||
* 1. Some default assertions (e.g., nav bar, status bar and screen covered)
|
||||
* are inherited [RotationTransition]
|
||||
* 2. Part of the test setup occurs automatically via
|
||||
* [com.android.server.wm.flicker.TransitionRunnerWithRules],
|
||||
* including configuring navigation mode, initial orientation and ensuring no
|
||||
* apps are running before setup
|
||||
*/
|
||||
@RequiresDevice
|
||||
@RunWith(Parameterized::class)
|
||||
@@ -61,6 +94,9 @@ class SeamlessAppRotationTest(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] window is always in full screen
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowFullScreen() {
|
||||
@@ -75,6 +111,9 @@ class SeamlessAppRotationTest(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] window is always with seamless rotation
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appWindowSeamlessRotation() {
|
||||
@@ -90,6 +129,9 @@ class SeamlessAppRotationTest(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] window is always visible
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayerAlwaysVisible() {
|
||||
@@ -98,6 +140,9 @@ class SeamlessAppRotationTest(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that [testApp] layer covers the entire screen during the whole transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun appLayerRotates() {
|
||||
@@ -110,29 +155,36 @@ class SeamlessAppRotationTest(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [FlickerComponentName.STATUS_BAR] window is invisible during the whole
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarWindowIsAlwaysInvisible() {
|
||||
testSpec.assertWm {
|
||||
this.isAboveAppWindowInvisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
this.isAboveAppWindowInvisible(FlickerComponentName.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the [FlickerComponentName.STATUS_BAR] layer is invisible during the whole
|
||||
* transition
|
||||
*/
|
||||
@Presubmit
|
||||
@Test
|
||||
fun statusBarLayerIsAlwaysInvisible() {
|
||||
testSpec.assertLayers {
|
||||
this.isInvisible(WindowManagerStateHelper.STATUS_BAR_COMPONENT)
|
||||
this.isInvisible(FlickerComponentName.STATUS_BAR)
|
||||
}
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@FlakyTest
|
||||
@Test
|
||||
override fun navBarLayerRotatesAndScales() = super.navBarLayerRotatesAndScales()
|
||||
|
||||
companion object {
|
||||
private val testFactory = FlickerTestParameterFactory.getInstance()
|
||||
|
||||
private val Map<String, Any?>.starveUiThread
|
||||
get() = this.getOrDefault(ActivityOptions.EXTRA_STARVE_UI_THREAD, false) as Boolean
|
||||
|
||||
@@ -144,20 +196,34 @@ class SeamlessAppRotationTest(
|
||||
return config
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the test configurations for seamless rotation based on the default rotation
|
||||
* tests from [FlickerTestParameterFactory.getConfigRotationTests], but adding an
|
||||
* additional flag ([ActivityOptions.EXTRA_STARVE_UI_THREAD]) to indicate if the app
|
||||
* should starve the UI thread of not
|
||||
*/
|
||||
@JvmStatic
|
||||
private fun getConfigurations(): List<FlickerTestParameter> {
|
||||
return testFactory.getConfigRotationTests(repetitions = 2).flatMap {
|
||||
val defaultRun = it.createConfig(starveUiThread = false)
|
||||
val busyUiRun = it.createConfig(starveUiThread = true)
|
||||
listOf(
|
||||
FlickerTestParameter(defaultRun),
|
||||
FlickerTestParameter(busyUiRun,
|
||||
name = "${FlickerTestParameter.defaultName(busyUiRun)}_BUSY_UI_THREAD"
|
||||
return FlickerTestParameterFactory.getInstance()
|
||||
.getConfigRotationTests(repetitions = 2)
|
||||
.flatMap {
|
||||
val defaultRun = it.createConfig(starveUiThread = false)
|
||||
val busyUiRun = it.createConfig(starveUiThread = true)
|
||||
listOf(
|
||||
FlickerTestParameter(defaultRun),
|
||||
FlickerTestParameter(busyUiRun,
|
||||
name = "${FlickerTestParameter.defaultName(busyUiRun)}_BUSY_UI_THREAD"
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the test configurations.
|
||||
*
|
||||
* See [FlickerTestParameterFactory.getConfigRotationTests] for configuring
|
||||
* repetitions, screen orientation and navigation modes.
|
||||
*/
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
@JvmStatic
|
||||
fun getParams(): Collection<FlickerTestParameter> {
|
||||
|
||||
Reference in New Issue
Block a user