Loading tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +5 −3 Original line number Diff line number Diff line Loading @@ -48,11 +48,12 @@ fun WmAssertion.navBarWindowIsAlwaysVisible( } fun WmAssertion.visibleWindowsShownMoreThanOneConsecutiveEntry( ignoreWindows: List<String> = emptyList(), bugId: Int = 0, enabled: Boolean = bugId == 0 ) { all("visibleWindowShownMoreThanOneConsecutiveEntry", bugId, enabled) { this.visibleWindowsShownMoreThanOneConsecutiveEntry() all("visibleWindowsShownMoreThanOneConsecutiveEntry", bugId, enabled) { this.visibleWindowsShownMoreThanOneConsecutiveEntry(ignoreWindows) } } Loading Loading @@ -204,11 +205,12 @@ fun LayersAssertion.statusBarLayerRotatesScales( } fun LayersAssertion.visibleLayersShownMoreThanOneConsecutiveEntry( ignoreLayers: List<String> = emptyList(), bugId: Int = 0, enabled: Boolean = bugId == 0 ) { all("visibleLayersShownMoreThanOneConsecutiveEntry", bugId, enabled) { this.visibleLayersShownMoreThanOneConsecutiveEntry() this.visibleLayersShownMoreThanOneConsecutiveEntry(ignoreLayers) } } Loading tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt +5 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ 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.traces.parser.windowmanager.WindowManagerStateHelper import org.junit.Assert open class ImeAppHelper( Loading @@ -38,7 +39,7 @@ open class ImeAppHelper( Assert.assertNotNull("Text field not found, this usually happens when the device " + "was left in an unknown state (e.g. in split screen)", editText) editText.click() if (!device.waitForIME()) { if (!WindowManagerStateHelper().waitImeWindowShown()) { Assert.fail("IME did not appear") } } Loading @@ -46,6 +47,8 @@ open class ImeAppHelper( open fun closeIME(device: UiDevice) { device.pressBack() // Using only the AccessibilityInfo it is not possible to identify if the IME is active device.waitForIdle(1000) if (!WindowManagerStateHelper().waitImeWindowGone()) { Assert.fail("IME did not close") } } } No newline at end of file tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt +12 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper import com.android.server.wm.flicker.helpers.buildTestTag import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible Loading Loading @@ -66,8 +68,10 @@ class CloseImeAutoOpenWindowToAppTest( withTag { buildTestTag("imeToAppAutoOpen", testApp, configuration) } repeat { configuration.repetitions } setup { eachRun { test { device.wakeUpAndGoToHomeScreen() } eachRun { this.setRotation(configuration.startRotation) testApp.open() testApp.openIME(device) Loading @@ -80,14 +84,15 @@ class CloseImeAutoOpenWindowToAppTest( } } transitions { device.pressBack() device.waitForIdle() testApp.closeIME(device) } assertions { windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() imeAppWindowIsAlwaysVisible(testApp, bugId = 141458352) visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod")) imeAppWindowIsAlwaysVisible(testApp) } layersTrace { Loading @@ -96,8 +101,10 @@ class CloseImeAutoOpenWindowToAppTest( noUncoveredRegions(configuration.startRotation) navBarLayerRotatesAndScales(configuration.startRotation) statusBarLayerRotatesScales(configuration.startRotation) visibleLayersShownMoreThanOneConsecutiveEntry() imeLayerBecomesInvisible(bugId = 141458352) imeAppLayerIsAlwaysVisible(testApp, bugId = 141458352) imeAppLayerIsAlwaysVisible(testApp) } } } Loading tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt +14 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper import com.android.server.wm.flicker.helpers.buildTestTag import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible Loading Loading @@ -68,8 +70,10 @@ class CloseImeAutoOpenWindowToHomeTest( } repeat { configuration.repetitions } setup { eachRun { test { device.wakeUpAndGoToHomeScreen() } eachRun { this.setRotation(configuration.startRotation) testApp.open() testApp.openIME(device) Loading @@ -89,6 +93,8 @@ class CloseImeAutoOpenWindowToHomeTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE)) imeWindowBecomesInvisible(bugId = 141458352) imeAppWindowBecomesInvisible(testApp, bugId = 157449248) } Loading @@ -100,10 +106,14 @@ class CloseImeAutoOpenWindowToHomeTest( Surface.ROTATION_0, bugId = 140855415) statusBarLayerRotatesScales(configuration.startRotation, Surface.ROTATION_0) navBarLayerIsAlwaysVisible(enabled = false) statusBarLayerIsAlwaysVisible(enabled = false) navBarLayerIsAlwaysVisible( enabled = Surface.ROTATION_0 == configuration.startRotation) statusBarLayerIsAlwaysVisible( enabled = Surface.ROTATION_0 == configuration.startRotation) visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE)) imeLayerBecomesInvisible(bugId = 141458352) imeAppLayerBecomesInvisible(testApp, bugId = 153739621) imeAppLayerBecomesInvisible(testApp) } } } Loading tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt +10 −3 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible import com.android.server.wm.flicker.noUncoveredRegions import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.repetitions import com.android.server.wm.flicker.startRotation import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible Loading Loading @@ -65,8 +67,10 @@ class CloseImeWindowToAppTest( withTestName { buildTestTag("imeToApp", testApp, configuration) } repeat { configuration.repetitions } setup { eachRun { test { device.wakeUpAndGoToHomeScreen() } eachRun { this.setRotation(configuration.startRotation) testApp.open() testApp.openIME(device) Loading @@ -79,13 +83,14 @@ class CloseImeWindowToAppTest( } } transitions { device.pressBack() device.waitForIdle() testApp.closeIME(device) } assertions { windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod")) imeAppWindowIsAlwaysVisible(testApp) } Loading @@ -95,6 +100,8 @@ class CloseImeWindowToAppTest( noUncoveredRegions(configuration.startRotation) navBarLayerRotatesAndScales(configuration.startRotation) statusBarLayerRotatesScales(configuration.startRotation) visibleLayersShownMoreThanOneConsecutiveEntry() imeLayerBecomesInvisible(enabled = false) imeAppLayerIsAlwaysVisible(testApp) } Loading Loading
tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt +5 −3 Original line number Diff line number Diff line Loading @@ -48,11 +48,12 @@ fun WmAssertion.navBarWindowIsAlwaysVisible( } fun WmAssertion.visibleWindowsShownMoreThanOneConsecutiveEntry( ignoreWindows: List<String> = emptyList(), bugId: Int = 0, enabled: Boolean = bugId == 0 ) { all("visibleWindowShownMoreThanOneConsecutiveEntry", bugId, enabled) { this.visibleWindowsShownMoreThanOneConsecutiveEntry() all("visibleWindowsShownMoreThanOneConsecutiveEntry", bugId, enabled) { this.visibleWindowsShownMoreThanOneConsecutiveEntry(ignoreWindows) } } Loading Loading @@ -204,11 +205,12 @@ fun LayersAssertion.statusBarLayerRotatesScales( } fun LayersAssertion.visibleLayersShownMoreThanOneConsecutiveEntry( ignoreLayers: List<String> = emptyList(), bugId: Int = 0, enabled: Boolean = bugId == 0 ) { all("visibleLayersShownMoreThanOneConsecutiveEntry", bugId, enabled) { this.visibleLayersShownMoreThanOneConsecutiveEntry() this.visibleLayersShownMoreThanOneConsecutiveEntry(ignoreLayers) } } Loading
tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt +5 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ 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.traces.parser.windowmanager.WindowManagerStateHelper import org.junit.Assert open class ImeAppHelper( Loading @@ -38,7 +39,7 @@ open class ImeAppHelper( Assert.assertNotNull("Text field not found, this usually happens when the device " + "was left in an unknown state (e.g. in split screen)", editText) editText.click() if (!device.waitForIME()) { if (!WindowManagerStateHelper().waitImeWindowShown()) { Assert.fail("IME did not appear") } } Loading @@ -46,6 +47,8 @@ open class ImeAppHelper( open fun closeIME(device: UiDevice) { device.pressBack() // Using only the AccessibilityInfo it is not possible to identify if the IME is active device.waitForIdle(1000) if (!WindowManagerStateHelper().waitImeWindowGone()) { Assert.fail("IME did not close") } } } No newline at end of file
tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt +12 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper import com.android.server.wm.flicker.helpers.buildTestTag import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible Loading Loading @@ -66,8 +68,10 @@ class CloseImeAutoOpenWindowToAppTest( withTag { buildTestTag("imeToAppAutoOpen", testApp, configuration) } repeat { configuration.repetitions } setup { eachRun { test { device.wakeUpAndGoToHomeScreen() } eachRun { this.setRotation(configuration.startRotation) testApp.open() testApp.openIME(device) Loading @@ -80,14 +84,15 @@ class CloseImeAutoOpenWindowToAppTest( } } transitions { device.pressBack() device.waitForIdle() testApp.closeIME(device) } assertions { windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() imeAppWindowIsAlwaysVisible(testApp, bugId = 141458352) visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod")) imeAppWindowIsAlwaysVisible(testApp) } layersTrace { Loading @@ -96,8 +101,10 @@ class CloseImeAutoOpenWindowToAppTest( noUncoveredRegions(configuration.startRotation) navBarLayerRotatesAndScales(configuration.startRotation) statusBarLayerRotatesScales(configuration.startRotation) visibleLayersShownMoreThanOneConsecutiveEntry() imeLayerBecomesInvisible(bugId = 141458352) imeAppLayerIsAlwaysVisible(testApp, bugId = 141458352) imeAppLayerIsAlwaysVisible(testApp) } } } Loading
tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt +14 −4 Original line number Diff line number Diff line Loading @@ -27,6 +27,8 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper import com.android.server.wm.flicker.helpers.buildTestTag import com.android.server.wm.flicker.helpers.setRotation import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible Loading Loading @@ -68,8 +70,10 @@ class CloseImeAutoOpenWindowToHomeTest( } repeat { configuration.repetitions } setup { eachRun { test { device.wakeUpAndGoToHomeScreen() } eachRun { this.setRotation(configuration.startRotation) testApp.open() testApp.openIME(device) Loading @@ -89,6 +93,8 @@ class CloseImeAutoOpenWindowToHomeTest( windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE)) imeWindowBecomesInvisible(bugId = 141458352) imeAppWindowBecomesInvisible(testApp, bugId = 157449248) } Loading @@ -100,10 +106,14 @@ class CloseImeAutoOpenWindowToHomeTest( Surface.ROTATION_0, bugId = 140855415) statusBarLayerRotatesScales(configuration.startRotation, Surface.ROTATION_0) navBarLayerIsAlwaysVisible(enabled = false) statusBarLayerIsAlwaysVisible(enabled = false) navBarLayerIsAlwaysVisible( enabled = Surface.ROTATION_0 == configuration.startRotation) statusBarLayerIsAlwaysVisible( enabled = Surface.ROTATION_0 == configuration.startRotation) visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE)) imeLayerBecomesInvisible(bugId = 141458352) imeAppLayerBecomesInvisible(testApp, bugId = 153739621) imeAppLayerBecomesInvisible(testApp) } } } Loading
tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt +10 −3 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible import com.android.server.wm.flicker.noUncoveredRegions import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry import com.android.server.wm.flicker.repetitions import com.android.server.wm.flicker.startRotation import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible Loading Loading @@ -65,8 +67,10 @@ class CloseImeWindowToAppTest( withTestName { buildTestTag("imeToApp", testApp, configuration) } repeat { configuration.repetitions } setup { eachRun { test { device.wakeUpAndGoToHomeScreen() } eachRun { this.setRotation(configuration.startRotation) testApp.open() testApp.openIME(device) Loading @@ -79,13 +83,14 @@ class CloseImeWindowToAppTest( } } transitions { device.pressBack() device.waitForIdle() testApp.closeIME(device) } assertions { windowManagerTrace { navBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible() visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod")) imeAppWindowIsAlwaysVisible(testApp) } Loading @@ -95,6 +100,8 @@ class CloseImeWindowToAppTest( noUncoveredRegions(configuration.startRotation) navBarLayerRotatesAndScales(configuration.startRotation) statusBarLayerRotatesScales(configuration.startRotation) visibleLayersShownMoreThanOneConsecutiveEntry() imeLayerBecomesInvisible(enabled = false) imeAppLayerIsAlwaysVisible(testApp) } Loading