From 0f3645b868fec626f7861ab857811c92d987ed2c Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Thu, 28 Jan 2021 17:58:05 +0100 Subject: [PATCH] Reduce flicker memory consumption (Pt 3) Improve flicker memory consumption with the following: - Ensure each assertion has a name for use with parameterized runner Bug: 178572522 Test: atest FickerTests WMShellFlickerTests Change-Id: I84af8ccccbbe42533013be664c91521fe49f7021 --- .../apppairs/AppPairsTestCannotPairNonResizeableApps.kt | 4 ++-- .../apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt | 2 +- .../apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt | 2 +- .../flicker/apppairs/RotateTwoLaunchedAppsInAppPairsMode.kt | 4 ++-- .../RotateTwoLaunchedAppsRotateAndEnterAppPairsMode.kt | 2 +- .../flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt | 6 +++--- .../flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt | 4 ++-- .../NonResizableDismissInLegacySplitScreenTest.kt | 2 +- .../NonResizableLaunchInLegacySplitScreenTest.kt | 2 +- .../flicker/legacysplitscreen/RotateOneLaunchedAppTest.kt | 4 ++-- .../flicker/legacysplitscreen/RotateTwoLaunchedAppTest.kt | 4 ++-- .../src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestCannotPairNonResizeableApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestCannotPairNonResizeableApps.kt index b5d5d0fe8a38f..564a418a10823 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestCannotPairNonResizeableApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestCannotPairNonResizeableApps.kt @@ -54,7 +54,7 @@ class AppPairsTestCannotPairNonResizeableApps( @Parameterized.Parameters(name = "{0}") @JvmStatic fun getParams(): List> { - val testTag = "testAppPairs_unpairPrimaryAndSecondaryApps" + val testTag = "testAppPairs_cannotPairNonResizeableApps" val testSpec: FlickerBuilder.(Bundle) -> Unit = { configuration -> withTestName { buildTestTag(testTag, configuration) @@ -71,7 +71,7 @@ class AppPairsTestCannotPairNonResizeableApps( appPairsDividerIsInvisible() } windowManagerTrace { - end { + end("onlyResizeableAppWindowVisible") { val nonResizeableApp = nonResizeableApp require(nonResizeableApp != null) { "Non resizeable app not initialized" diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt index 54e074c9c25d4..f63eb1db4d5c9 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestPairPrimaryAndSecondaryApps.kt @@ -76,7 +76,7 @@ class AppPairsTestPairPrimaryAndSecondaryApps( } } windowManagerTrace { - end { + end("bothAppWindowsVisible") { isVisible(primaryApp.defaultWindowName) isVisible(secondaryApp.defaultWindowName) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt index 854a5041f6314..731d99829b1de 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestUnpairPrimaryAndSecondaryApps.kt @@ -85,7 +85,7 @@ class AppPairsTestUnpairPrimaryAndSecondaryApps( } } windowManagerTrace { - end { + end("bothAppWindowsInvisible") { isInvisible(primaryApp.defaultWindowName) isInvisible(secondaryApp.defaultWindowName) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsInAppPairsMode.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsInAppPairsMode.kt index c436eb2d01d54..da3450bf9ff67 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsInAppPairsMode.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsInAppPairsMode.kt @@ -66,7 +66,7 @@ class RotateTwoLaunchedAppsInAppPairsMode( val instrumentation = InstrumentationRegistry.getInstrumentation() val testSpec: FlickerBuilder.(Bundle) -> Unit = { configuration -> withTestName { - buildTestTag("testRotateAndEnterAppPairsMode", configuration) + buildTestTag("testRotateTwoLaunchedAppsInAppPairsMode", configuration) } transitions { executeShellCommand(composePairsCommand( @@ -88,7 +88,7 @@ class RotateTwoLaunchedAppsInAppPairsMode( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("bothAppWindowsVisible") { isVisible(primaryApp.defaultWindowName) .isVisible(secondaryApp.defaultWindowName) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsRotateAndEnterAppPairsMode.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsRotateAndEnterAppPairsMode.kt index cd4f4f62d1b39..05543fdb3445e 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsRotateAndEnterAppPairsMode.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/RotateTwoLaunchedAppsRotateAndEnterAppPairsMode.kt @@ -88,7 +88,7 @@ class RotateTwoLaunchedAppsRotateAndEnterAppPairsMode( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("bothAppWindowsVisible") { isVisible(primaryApp.defaultWindowName) isVisible(secondaryApp.defaultWindowName) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt index af99543199ac5..207ff0bcd68d9 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/EnterLegacySplitScreenTest.kt @@ -115,7 +115,7 @@ class EnterLegacySplitScreenTest( ) } windowManagerTrace { - end { + end("appWindowIsVisible") { isVisible(splitScreenApp.defaultWindowName) } } @@ -150,7 +150,7 @@ class EnterLegacySplitScreenTest( ) } windowManagerTrace { - end { + end("appWindowIsVisible") { isVisible(splitScreenApp.defaultWindowName) .isVisible(secondaryApp.defaultWindowName) } @@ -185,7 +185,7 @@ class EnterLegacySplitScreenTest( ) } windowManagerTrace { - end { + end("appWindowIsVisible") { isInvisible(nonResizeableApp.defaultWindowName) } visibleWindowsShownMoreThanOneConsecutiveEntry( diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt index cd9a3c998d583..701b0d05e65ce 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/ExitLegacySplitScreenTest.kt @@ -104,7 +104,7 @@ class ExitLegacySplitScreenTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("appWindowIsInvisible") { isInvisible(splitScreenApp.defaultWindowName) } } @@ -132,7 +132,7 @@ class ExitLegacySplitScreenTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("appWindowIsVisible") { isVisible(splitScreenApp.defaultWindowName) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableDismissInLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableDismissInLegacySplitScreenTest.kt index e79820f520dd7..6fca5809b4fa6 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableDismissInLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableDismissInLegacySplitScreenTest.kt @@ -72,7 +72,7 @@ class NonResizableDismissInLegacySplitScreenTest( ) } windowManagerTrace { - end { + end("nonResizeableAppWindowIsVisible") { isVisible(nonResizeableApp.defaultWindowName) .isInvisible(splitScreenApp.defaultWindowName) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableLaunchInLegacySplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableLaunchInLegacySplitScreenTest.kt index 280af5d708c9b..deae41fae0cae 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableLaunchInLegacySplitScreenTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/NonResizableLaunchInLegacySplitScreenTest.kt @@ -72,7 +72,7 @@ class NonResizableLaunchInLegacySplitScreenTest( ) } windowManagerTrace { - end { + end("nonResizeableAppWindowIsVisible") { isVisible(nonResizeableApp.defaultWindowName) .isInvisible(splitScreenApp.defaultWindowName) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateOneLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateOneLaunchedAppTest.kt index fdf88df0f6971..07571c3218a83 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateOneLaunchedAppTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateOneLaunchedAppTest.kt @@ -99,7 +99,7 @@ class RotateOneLaunchedAppTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("appWindowIsVisible") { isVisible(splitScreenApp.defaultWindowName) } } @@ -131,7 +131,7 @@ class RotateOneLaunchedAppTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("appWindowIsVisible") { isVisible(splitScreenApp.defaultWindowName) } } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateTwoLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateTwoLaunchedAppTest.kt index 785ccf003504e..6b43851da3216 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateTwoLaunchedAppTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/legacysplitscreen/RotateTwoLaunchedAppTest.kt @@ -104,7 +104,7 @@ class RotateTwoLaunchedAppTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("appWindowIsVisible") { isVisible(splitScreenApp.defaultWindowName) .isVisible(secondaryApp.defaultWindowName) } @@ -141,7 +141,7 @@ class RotateTwoLaunchedAppTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() - end { + end("appWindowIsVisible") { isVisible(splitScreenApp.defaultWindowName) .isVisible(secondaryApp.defaultWindowName) } diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt index 812353ffe9554..c21b594246b9f 100644 --- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt +++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/pip/PipKeyboardTest.kt @@ -131,7 +131,7 @@ class PipKeyboardTest( } assertions { windowManagerTrace { - end { + end("imeWindowAboveApp") { isAboveWindow(IME_WINDOW_NAME, testApp.defaultWindowName) } }