diff options
7 files changed, 240 insertions, 204 deletions
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt index fde97ba8b4df..c7736f825e27 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt @@ -16,8 +16,6 @@ package com.android.server.wm.flicker.ime -import androidx.test.filters.FlakyTest -import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry @@ -48,11 +46,9 @@ import org.junit.runners.Parameterized * Test IME window closing back to app window transitions. * To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToAppTest` */ -@Presubmit @RequiresDevice @RunWith(Parameterized::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@FlakyTest(bugId = 178015460) class CloseImeAutoOpenWindowToAppTest( testSpec: FlickerTestRunnerFactory.TestSpec ) : FlickerTestRunner(testSpec) { @@ -66,7 +62,7 @@ class CloseImeAutoOpenWindowToAppTest( .buildTest(instrumentation, repetitions = 5) { configuration -> val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) - withTestName { buildTestTag("imeToAppAutoOpen", configuration) } + withTestName { buildTestTag(configuration) } repeat { configuration.repetitions } setup { test { @@ -89,26 +85,39 @@ class CloseImeAutoOpenWindowToAppTest( testApp.closeIME(device, wmHelper) } assertions { - windowManagerTrace { - navBarWindowIsAlwaysVisible() - statusBarWindowIsAlwaysVisible() - visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod")) + val isRotated = configuration.startRotation.isRotated() - imeAppWindowIsAlwaysVisible(testApp) + postsubmit { + windowManagerTrace { + navBarWindowIsAlwaysVisible() + statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry( + listOf(IME_WINDOW_TITLE)) + imeAppWindowIsAlwaysVisible(testApp) + } + + layersTrace { + navBarLayerIsAlwaysVisible() + statusBarLayerIsAlwaysVisible() + noUncoveredRegions(configuration.startRotation) + imeLayerBecomesInvisible() + imeAppLayerIsAlwaysVisible(testApp) + if (!isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation) + statusBarLayerRotatesScales(configuration.startRotation) + } + } } - layersTrace { - navBarLayerIsAlwaysVisible() - statusBarLayerIsAlwaysVisible() - noUncoveredRegions(configuration.startRotation) - navBarLayerRotatesAndScales(configuration.startRotation, - enabled = !configuration.startRotation.isRotated()) - statusBarLayerRotatesScales(configuration.startRotation, - enabled = !configuration.startRotation.isRotated()) - visibleLayersShownMoreThanOneConsecutiveEntry() + flaky { + layersTrace { + visibleLayersShownMoreThanOneConsecutiveEntry() - imeLayerBecomesInvisible() - imeAppLayerIsAlwaysVisible(testApp) + if (isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation) + statusBarLayerRotatesScales(configuration.startRotation) + } + } } } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt index ab7c08f7902b..aa24456c652f 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt @@ -16,7 +16,6 @@ package com.android.server.wm.flicker.ime -import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry @@ -47,7 +46,6 @@ import org.junit.runners.Parameterized * Test IME window closing back to app window transitions. * To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToHomeTest` */ -@Presubmit @RequiresDevice @RunWith(Parameterized::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -65,7 +63,7 @@ class CloseImeAutoOpenWindowToHomeTest( val testApp = ImeAppAutoFocusHelper(instrumentation, configuration.startRotation) withTestName { - buildTestTag("imeToHomeAutoOpen", configuration) + buildTestTag(configuration) } repeat { configuration.repetitions } setup { @@ -90,32 +88,50 @@ class CloseImeAutoOpenWindowToHomeTest( wmHelper.waitImeWindowGone() } assertions { - windowManagerTrace { - navBarWindowIsAlwaysVisible() - statusBarWindowIsAlwaysVisible() - visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE)) + val isRotated = configuration.startRotation.isRotated() - imeWindowBecomesInvisible() - imeAppWindowBecomesInvisible(testApp) - } + presubmit { + windowManagerTrace { + navBarWindowIsAlwaysVisible() + statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry( + listOf(IME_WINDOW_TITLE)) + + imeWindowBecomesInvisible() + imeAppWindowBecomesInvisible(testApp) + } - layersTrace { - noUncoveredRegions(configuration.startRotation, Surface.ROTATION_0) - navBarLayerRotatesAndScales(configuration.startRotation, - Surface.ROTATION_0, - enabled = !configuration.startRotation.isRotated()) - statusBarLayerRotatesScales(configuration.startRotation, - Surface.ROTATION_0, - enabled = !configuration.startRotation.isRotated()) - navBarLayerIsAlwaysVisible( - enabled = !configuration.startRotation.isRotated()) - statusBarLayerIsAlwaysVisible( - enabled = !configuration.startRotation.isRotated()) - visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE), - enabled = !configuration.startRotation.isRotated()) + layersTrace { + noUncoveredRegions(configuration.startRotation, Surface.ROTATION_0) + imeLayerBecomesInvisible() + imeAppLayerBecomesInvisible(testApp) + + if (!isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation, + Surface.ROTATION_0) + statusBarLayerRotatesScales(configuration.startRotation, + Surface.ROTATION_0) + navBarLayerIsAlwaysVisible() + statusBarLayerIsAlwaysVisible() + visibleLayersShownMoreThanOneConsecutiveEntry( + listOf(IME_WINDOW_TITLE)) + } + } + } - imeLayerBecomesInvisible() - imeAppLayerBecomesInvisible(testApp) + flaky { + layersTrace { + if (isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation, + Surface.ROTATION_0) + statusBarLayerRotatesScales(configuration.startRotation, + Surface.ROTATION_0) + navBarLayerIsAlwaysVisible() + statusBarLayerIsAlwaysVisible() + visibleLayersShownMoreThanOneConsecutiveEntry( + listOf(IME_WINDOW_TITLE)) + } + } } } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt index 0503cce0fbb1..2bd5abb640e5 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt @@ -16,8 +16,6 @@ package com.android.server.wm.flicker.ime -import androidx.test.filters.FlakyTest -import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry @@ -47,11 +45,9 @@ import org.junit.runners.Parameterized * Test IME window closing back to app window transitions. * To run this test: `atest FlickerTests:CloseImeWindowToAppTest` */ -@Presubmit @RequiresDevice @RunWith(Parameterized::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@FlakyTest(bugId = 178015460) class CloseImeWindowToAppTest( testSpec: FlickerTestRunnerFactory.TestSpec ) : FlickerTestRunner(testSpec) { @@ -64,7 +60,7 @@ class CloseImeWindowToAppTest( val testApp = ImeAppHelper(instrumentation) return FlickerTestRunnerFactory.getInstance() .buildTest(instrumentation, repetitions = 5) { configuration -> - withTestName { buildTestTag("imeToApp", configuration) } + withTestName { buildTestTag(configuration) } repeat { configuration.repetitions } setup { test { @@ -86,24 +82,25 @@ class CloseImeWindowToAppTest( testApp.closeIME(device, wmHelper) } assertions { - windowManagerTrace { - navBarWindowIsAlwaysVisible() - statusBarWindowIsAlwaysVisible() - visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod")) + postsubmit { + windowManagerTrace { + navBarWindowIsAlwaysVisible() + statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry( + listOf(IME_WINDOW_TITLE)) + imeAppWindowIsAlwaysVisible(testApp) + } - imeAppWindowIsAlwaysVisible(testApp) - } - - layersTrace { - navBarLayerIsAlwaysVisible() - statusBarLayerIsAlwaysVisible() - noUncoveredRegions(configuration.startRotation) - navBarLayerRotatesAndScales(configuration.startRotation) - statusBarLayerRotatesScales(configuration.startRotation) - visibleLayersShownMoreThanOneConsecutiveEntry() - - imeLayerBecomesInvisible() - imeAppLayerIsAlwaysVisible(testApp) + layersTrace { + navBarLayerIsAlwaysVisible() + statusBarLayerIsAlwaysVisible() + noUncoveredRegions(configuration.startRotation) + navBarLayerRotatesAndScales(configuration.startRotation) + statusBarLayerRotatesScales(configuration.startRotation) + visibleLayersShownMoreThanOneConsecutiveEntry() + imeLayerBecomesInvisible() + imeAppLayerIsAlwaysVisible(testApp) + } } } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt index 9cb075b8a0bd..7b61bb58446c 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt @@ -16,8 +16,6 @@ package com.android.server.wm.flicker.ime -import androidx.test.filters.FlakyTest -import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry @@ -47,11 +45,9 @@ import org.junit.runners.Parameterized * Test IME window closing to home transitions. * To run this test: `atest FlickerTests:CloseImeWindowToHomeTest` */ -@Presubmit @RequiresDevice @RunWith(Parameterized::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@FlakyTest(bugId = 178015460) class CloseImeWindowToHomeTest( testSpec: FlickerTestRunnerFactory.TestSpec ) : FlickerTestRunner(testSpec) { @@ -63,7 +59,7 @@ class CloseImeWindowToHomeTest( val testApp = ImeAppHelper(instrumentation) return FlickerTestRunnerFactory.getInstance() .buildTest(instrumentation, repetitions = 5) { configuration -> - withTestName { buildTestTag("imeToHome", configuration) } + withTestName { buildTestTag(configuration) } repeat { configuration.repetitions } setup { test { @@ -91,31 +87,47 @@ class CloseImeWindowToHomeTest( } } assertions { - windowManagerTrace { - navBarWindowIsAlwaysVisible() - statusBarWindowIsAlwaysVisible() - visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE)) + val isRotated = configuration.startRotation.isRotated() - imeWindowBecomesInvisible() - imeAppWindowBecomesInvisible(testApp) + postsubmit { + windowManagerTrace { + navBarWindowIsAlwaysVisible() + statusBarWindowIsAlwaysVisible() + visibleWindowsShownMoreThanOneConsecutiveEntry( + listOf(IME_WINDOW_TITLE)) + imeWindowBecomesInvisible() + imeAppWindowBecomesInvisible(testApp) + } + + layersTrace { + navBarLayerIsAlwaysVisible() + statusBarLayerIsAlwaysVisible() + imeLayerBecomesInvisible() + imeAppLayerBecomesInvisible(testApp) + noUncoveredRegions(configuration.startRotation, + Surface.ROTATION_0) + + if (!isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation, + Surface.ROTATION_0) + statusBarLayerRotatesScales(configuration.startRotation, + Surface.ROTATION_0) + } + } } - layersTrace { - noUncoveredRegions(configuration.startRotation, - Surface.ROTATION_0) - navBarLayerRotatesAndScales(configuration.startRotation, - Surface.ROTATION_0, - enabled = !configuration.startRotation.isRotated()) - statusBarLayerRotatesScales(configuration.startRotation, - Surface.ROTATION_0, - enabled = !configuration.startRotation.isRotated()) - navBarLayerIsAlwaysVisible() - statusBarLayerIsAlwaysVisible() - visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE), - enabled = false) + flaky { + layersTrace { + visibleLayersShownMoreThanOneConsecutiveEntry( + listOf(IME_WINDOW_TITLE)) - imeLayerBecomesInvisible() - imeAppLayerBecomesInvisible(testApp) + if (isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation, + Surface.ROTATION_0) + statusBarLayerRotatesScales(configuration.startRotation, + Surface.ROTATION_0) + } + } } } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CommonAssertions.kt index c775cb855ff4..cfdd8564128f 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CommonAssertions.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CommonAssertions.kt @@ -17,106 +17,82 @@ package com.android.server.wm.flicker.ime import android.platform.helpers.IAppHelper -import com.android.server.wm.flicker.dsl.LayersAssertionBuilderLegacy -import com.android.server.wm.flicker.dsl.WmAssertionBuilderLegacy +import com.android.server.wm.flicker.dsl.LayersAssertionBuilder +import com.android.server.wm.flicker.dsl.WmAssertionBuilder const val IME_WINDOW_TITLE = "InputMethod" @JvmOverloads -fun LayersAssertionBuilderLegacy.imeLayerBecomesVisible( - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeLayerBecomesVisible", bugId, enabled) { +fun LayersAssertionBuilder.imeLayerBecomesVisible(bugId: Int = 0) { + all("imeLayerBecomesVisible", bugId) { this.hidesLayer(IME_WINDOW_TITLE) .then() .showsLayer(IME_WINDOW_TITLE) } } -fun LayersAssertionBuilderLegacy.imeLayerBecomesInvisible( - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeLayerBecomesInvisible", bugId, enabled) { +@JvmOverloads +fun LayersAssertionBuilder.imeLayerBecomesInvisible(bugId: Int = 0) { + all("imeLayerBecomesInvisible", bugId) { this.showsLayer(IME_WINDOW_TITLE) .then() .hidesLayer(IME_WINDOW_TITLE) } } -fun LayersAssertionBuilderLegacy.imeAppLayerIsAlwaysVisible( - testApp: IAppHelper, - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeAppLayerIsAlwaysVisible", bugId, enabled) { +@JvmOverloads +fun LayersAssertionBuilder.imeAppLayerIsAlwaysVisible(testApp: IAppHelper, bugId: Int = 0) { + all("imeAppLayerIsAlwaysVisible", bugId) { this.showsLayer(testApp.getPackage()) } } -fun WmAssertionBuilderLegacy.imeAppWindowIsAlwaysVisible( - testApp: IAppHelper, - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeAppWindowIsAlwaysVisible", bugId, enabled) { +@JvmOverloads +fun WmAssertionBuilder.imeAppWindowIsAlwaysVisible(testApp: IAppHelper, bugId: Int = 0) { + all("imeAppWindowIsAlwaysVisible", bugId) { this.showsAppWindowOnTop(testApp.getPackage()) } } -fun WmAssertionBuilderLegacy.imeWindowBecomesVisible( - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeWindowBecomesVisible", bugId, enabled) { +@JvmOverloads +fun WmAssertionBuilder.imeWindowBecomesVisible(bugId: Int = 0) { + all("imeWindowBecomesVisible", bugId) { this.hidesNonAppWindow(IME_WINDOW_TITLE) .then() .showsNonAppWindow(IME_WINDOW_TITLE) } } -fun WmAssertionBuilderLegacy.imeWindowBecomesInvisible( - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeWindowBecomesInvisible", bugId, enabled) { +@JvmOverloads +fun WmAssertionBuilder.imeWindowBecomesInvisible(bugId: Int = 0) { + all("imeWindowBecomesInvisible", bugId) { this.showsNonAppWindow(IME_WINDOW_TITLE) .then() .hidesNonAppWindow(IME_WINDOW_TITLE) } } -fun WmAssertionBuilderLegacy.imeAppWindowBecomesVisible( - windowName: String, - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeAppWindowBecomesVisible", bugId, enabled) { +@JvmOverloads +fun WmAssertionBuilder.imeAppWindowBecomesVisible(windowName: String, bugId: Int = 0) { + all("imeAppWindowBecomesVisible", bugId) { this.hidesAppWindow(windowName) .then() .showsAppWindow(windowName) } } -fun WmAssertionBuilderLegacy.imeAppWindowBecomesInvisible( - testApp: IAppHelper, - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeAppWindowBecomesInvisible", bugId, enabled) { +@JvmOverloads +fun WmAssertionBuilder.imeAppWindowBecomesInvisible(testApp: IAppHelper, bugId: Int = 0) { + all("imeAppWindowBecomesInvisible", bugId) { this.showsAppWindowOnTop(testApp.getPackage()) .then() .appWindowNotOnTop(testApp.getPackage()) } } -fun LayersAssertionBuilderLegacy.imeAppLayerBecomesInvisible( - testApp: IAppHelper, - bugId: Int = 0, - enabled: Boolean = bugId == 0 -) { - all("imeAppLayerBecomesInvisible", bugId, enabled) { +@JvmOverloads +fun LayersAssertionBuilder.imeAppLayerBecomesInvisible(testApp: IAppHelper, bugId: Int = 0) { + all("imeAppLayerBecomesInvisible", bugId) { this.skipUntilFirstAssertion() .showsLayer(testApp.getPackage()) .then() diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt index 13c6cd7e6e18..9e94d6e49527 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt @@ -16,8 +16,6 @@ package com.android.server.wm.flicker.ime -import androidx.test.filters.FlakyTest -import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry @@ -50,11 +48,9 @@ import org.junit.runners.Parameterized * Test IME window opening transitions. * To run this test: `atest FlickerTests:OpenImeWindowTest` */ -@Presubmit @RequiresDevice @RunWith(Parameterized::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) -@FlakyTest(bugId = 178015460) class OpenImeWindowTest( testSpec: FlickerTestRunnerFactory.TestSpec ) : FlickerTestRunner(testSpec) { @@ -66,7 +62,7 @@ class OpenImeWindowTest( val testApp = ImeAppHelper(instrumentation) return FlickerTestRunnerFactory.getInstance() .buildTest(instrumentation, repetitions = 5) { configuration -> - withTestName { buildTestTag("openIme", configuration) } + withTestName { buildTestTag(configuration) } repeat { configuration.repetitions } setup { test { @@ -88,27 +84,43 @@ class OpenImeWindowTest( } } assertions { - windowManagerTrace { - navBarWindowIsAlwaysVisible() - statusBarWindowIsAlwaysVisible() - visibleWindowsShownMoreThanOneConsecutiveEntry() + val isRotated = configuration.startRotation.isRotated() - imeWindowBecomesVisible() - appWindowAlwaysVisibleOnTop(testApp.`package`) + postsubmit { + windowManagerTrace { + navBarWindowIsAlwaysVisible() + statusBarWindowIsAlwaysVisible() + + imeWindowBecomesVisible() + appWindowAlwaysVisibleOnTop(testApp.`package`) + } + + layersTrace { + navBarLayerIsAlwaysVisible() + statusBarLayerIsAlwaysVisible() + noUncoveredRegions(configuration.startRotation) + imeLayerBecomesVisible() + layerAlwaysVisible(testApp.`package`) + + if (!isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation) + statusBarLayerRotatesScales(configuration.startRotation) + } + } } - layersTrace { - navBarLayerIsAlwaysVisible() - statusBarLayerIsAlwaysVisible() - noUncoveredRegions(configuration.startRotation) - navBarLayerRotatesAndScales(configuration.startRotation, - enabled = !configuration.startRotation.isRotated()) - statusBarLayerRotatesScales(configuration.startRotation, - enabled = !configuration.startRotation.isRotated()) - visibleLayersShownMoreThanOneConsecutiveEntry() + flaky { + windowManagerTrace { + visibleWindowsShownMoreThanOneConsecutiveEntry() + } + layersTrace { + visibleLayersShownMoreThanOneConsecutiveEntry() - imeLayerBecomesVisible() - layerAlwaysVisible(testApp.`package`) + if (isRotated) { + navBarLayerRotatesAndScales(configuration.startRotation) + statusBarLayerRotatesScales(configuration.startRotation) + } + } } } } diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ReOpenImeWindowTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ReOpenImeWindowTest.kt index 6cc64dfd8836..2fe49af26cc1 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ReOpenImeWindowTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/ReOpenImeWindowTest.kt @@ -16,7 +16,6 @@ package com.android.server.wm.flicker.ime -import android.platform.test.annotations.Presubmit import android.view.Surface import androidx.test.filters.RequiresDevice import androidx.test.platform.app.InstrumentationRegistry @@ -52,7 +51,6 @@ import org.junit.runners.Parameterized * Test IME window opening transitions. * To run this test: `atest FlickerTests:ReOpenImeWindowTest` */ -@Presubmit @RequiresDevice @RunWith(Parameterized::class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -67,34 +65,37 @@ class ReOpenImeWindowTest( val testAppComponentName = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME return FlickerTestRunnerFactory.getInstance() .buildTest(instrumentation, repetitions = 1) { configuration -> - val testApp = ImeAppAutoFocusHelper(instrumentation, - configuration.startRotation) - withTestName { buildTestTag("reOpenImeAutoFocus", configuration) } - repeat { configuration.repetitions } - setup { - test { - device.wakeUpAndGoToHomeScreen() - testApp.launchViaIntent(wmHelper) - testApp.openIME(device, wmHelper) - } - eachRun { - device.pressRecentApps() - wmHelper.waitImeWindowGone() - wmHelper.waitForAppTransitionIdle() - this.setRotation(configuration.startRotation) - } + val testApp = ImeAppAutoFocusHelper(instrumentation, + configuration.startRotation) + withTestName { buildTestTag(configuration) } + repeat { configuration.repetitions } + setup { + test { + device.wakeUpAndGoToHomeScreen() + testApp.launchViaIntent(wmHelper) + testApp.openIME(device, wmHelper) } - transitions { - device.reopenAppFromOverview() - wmHelper.waitImeWindowShown() + eachRun { + device.pressRecentApps() + wmHelper.waitImeWindowGone() + wmHelper.waitForAppTransitionIdle() + this.setRotation(configuration.startRotation) } - teardown { - test { - this.setRotation(Surface.ROTATION_0) - testApp.exit() - } + } + transitions { + device.reopenAppFromOverview() + wmHelper.waitImeWindowShown() + } + teardown { + test { + this.setRotation(Surface.ROTATION_0) + testApp.exit() } - assertions { + } + assertions { + val isRotated = configuration.startRotation.isRotated() + + presubmit { windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() @@ -107,21 +108,34 @@ class ReOpenImeWindowTest( layersTrace { noUncoveredRegions(Surface.ROTATION_0, configuration.endRotation) - navBarLayerRotatesAndScales(Surface.ROTATION_0, - configuration.endRotation, - enabled = !configuration.startRotation.isRotated()) - statusBarLayerRotatesScales(Surface.ROTATION_0, - configuration.endRotation, - enabled = !configuration.startRotation.isRotated()) statusBarLayerIsAlwaysVisible() navBarLayerIsAlwaysVisible() - visibleLayersShownMoreThanOneConsecutiveEntry(enabled = false) - imeLayerBecomesVisible() appLayerReplacesWallpaperLayer(testAppComponentName.className) + + if (!isRotated) { + navBarLayerRotatesAndScales(Surface.ROTATION_0, + configuration.endRotation) + statusBarLayerRotatesScales(Surface.ROTATION_0, + configuration.endRotation) + } + } + } + + flaky { + layersTrace { + visibleLayersShownMoreThanOneConsecutiveEntry() + + if (isRotated) { + navBarLayerRotatesAndScales(Surface.ROTATION_0, + configuration.endRotation) + statusBarLayerRotatesScales(Surface.ROTATION_0, + configuration.endRotation) + } } } } + } } } }
\ No newline at end of file |