From ba9f1e4ae088239d780887bc835b40f44ba223d6 Mon Sep 17 00:00:00 2001 From: Nataniel Borges Date: Tue, 4 Oct 2022 09:59:44 +0000 Subject: [PATCH] Promote passing IME flicker tests Increase presubmit coverage Test: atest FlickerTests WMShellFlickerTests Change-Id: Ia14b3bca4756da9cc152390b7feba38dc158e011 --- .../ime/CloseImeEditorPopupDialogTest.kt | 38 +++++-------------- ...penImeWindowFromFixedOrientationAppTest.kt | 20 ++++++++-- .../ime/OpenImeWindowToOverViewTest.kt | 25 ++++++------ 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeEditorPopupDialogTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeEditorPopupDialogTest.kt index df1c43e56a58c..91d9a1f17d057 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeEditorPopupDialogTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeEditorPopupDialogTest.kt @@ -16,7 +16,7 @@ package com.android.server.wm.flicker.ime -import android.platform.test.annotations.Postsubmit +import android.platform.test.annotations.Presubmit import android.view.Surface import android.view.WindowManagerPolicyConstants import androidx.test.filters.RequiresDevice @@ -59,31 +59,11 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t } } - /** {@inheritDoc} */ - @Postsubmit + @Presubmit @Test - override fun taskBarWindowIsAlwaysVisible() = super.taskBarWindowIsAlwaysVisible() + fun imeWindowBecameInvisible() = testSpec.imeWindowBecomesInvisible() - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun visibleLayersShownMoreThanOneConsecutiveEntry() = - super.visibleLayersShownMoreThanOneConsecutiveEntry() - - /** {@inheritDoc} */ - @Postsubmit - @Test - override fun visibleWindowsShownMoreThanOneConsecutiveEntry() = - super.visibleWindowsShownMoreThanOneConsecutiveEntry() - - @Postsubmit @Test fun imeWindowBecameInvisible() = testSpec.imeWindowBecomesInvisible() - - @Postsubmit + @Presubmit @Test fun imeLayerAndImeSnapshotVisibleOnScreen() { testSpec.assertLayers { @@ -96,7 +76,7 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t } } - @Postsubmit + @Presubmit @Test fun imeSnapshotAssociatedOnAppVisibleRegion() { testSpec.assertLayers { @@ -130,10 +110,10 @@ class CloseImeEditorPopupDialogTest(testSpec: FlickerTestParameter) : BaseTest(t return FlickerTestParameterFactory.getInstance() .getConfigNonRotationTests( supportedNavigationModes = - listOf( - WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY, - WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY - ), + listOf( + WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY, + WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY + ), supportedRotations = listOf(Surface.ROTATION_0) ) } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt index ce63d8a96ffe7..3e18d5957eb7c 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowFromFixedOrientationAppTest.kt @@ -27,8 +27,10 @@ import com.android.server.wm.flicker.FlickerTestParameter import com.android.server.wm.flicker.FlickerTestParameterFactory import com.android.server.wm.flicker.dsl.FlickerBuilder import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper +import com.android.server.wm.flicker.helpers.isShellTransitionsEnabled import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.snapshotStartingWindowLayerCoversExactlyOnApp +import org.junit.Assume import org.junit.FixMethodOrder import org.junit.Test import org.junit.runner.RunWith @@ -78,13 +80,25 @@ class OpenImeWindowFromFixedOrientationAppTest(testSpec: FlickerTestParameter) : @Test override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd() - @Presubmit @Test fun imeWindowBecomesVisible() = testSpec.imeWindowBecomesVisible() + @Presubmit + @Test + fun imeWindowBecomesVisible() = testSpec.imeWindowBecomesVisible() - @Presubmit @Test fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible() + @Presubmit + @Test + fun imeLayerBecomesVisible() = testSpec.imeLayerBecomesVisible() @Postsubmit @Test fun snapshotStartingWindowLayerCoversExactlyOnApp() { + Assume.assumeFalse(isShellTransitionsEnabled) + testSpec.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp) + } + + @Presubmit + @Test + fun snapshotStartingWindowLayerCoversExactlyOnApp_ShellTransit() { + Assume.assumeTrue(isShellTransitionsEnabled) testSpec.snapshotStartingWindowLayerCoversExactlyOnApp(imeTestApp) } @@ -102,7 +116,7 @@ class OpenImeWindowFromFixedOrientationAppTest(testSpec: FlickerTestParameter) : .getConfigNonRotationTests( supportedRotations = listOf(Surface.ROTATION_90), supportedNavigationModes = - listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY) + listOf(WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY) ) } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowToOverViewTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowToOverViewTest.kt index 6c6f59ec382f1..0a7701e54b31b 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowToOverViewTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowToOverViewTest.kt @@ -16,7 +16,6 @@ package com.android.server.wm.flicker.ime -import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import android.platform.test.annotations.RequiresDevice import android.view.Surface @@ -69,7 +68,7 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes } /** - * The bars (including [ComponentMatcher.STATUS_BAR] and [ComponentMatcher.NAV_BAR]) are + * The bars (including [ComponentNameMatcher.STATUS_BAR] and [ComponentNameMatcher.NAV_BAR]) are * expected to be hidden while entering overview in landscape if launcher is set to portrait * only. Because "showing portrait overview (launcher) in landscape display" is an intermediate * state depending on the touch-up to decide the intention of gesture, the display may keep in @@ -158,24 +157,28 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes /** {@inheritDoc} */ @Test @Ignore("Visibility changes depending on orientation and navigation mode") - override fun navBarLayerIsVisibleAtStartAndEnd() {} + override fun navBarLayerIsVisibleAtStartAndEnd() { + } /** {@inheritDoc} */ @Test @Ignore("Visibility changes depending on orientation and navigation mode") - override fun navBarLayerPositionAtStartAndEnd() {} + override fun navBarLayerPositionAtStartAndEnd() { + } /** {@inheritDoc} */ @Test @Ignore("Visibility changes depending on orientation and navigation mode") - override fun statusBarLayerPositionAtStartAndEnd() {} + override fun statusBarLayerPositionAtStartAndEnd() { + } /** {@inheritDoc} */ @Test @Ignore("Visibility changes depending on orientation and navigation mode") - override fun statusBarLayerIsVisibleAtStartAndEnd() {} + override fun statusBarLayerIsVisibleAtStartAndEnd() { + } - @Postsubmit + @Presubmit @Test override fun taskBarLayerIsVisibleAtStartAndEnd() = super.taskBarLayerIsVisibleAtStartAndEnd() @@ -239,10 +242,10 @@ class OpenImeWindowToOverViewTest(testSpec: FlickerTestParameter) : BaseTest(tes .getConfigNonRotationTests( supportedRotations = listOf(Surface.ROTATION_0, Surface.ROTATION_90), supportedNavigationModes = - listOf( - WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY, - WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY - ) + listOf( + WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY, + WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY + ) ) } }