Merge "Update IME tests to new DSL format" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
9f44d9997c
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
imeLayerBecomesInvisible()
|
||||
imeAppLayerBecomesInvisible(testApp)
|
||||
|
||||
if (!isRotated) {
|
||||
navBarLayerRotatesAndScales(configuration.startRotation,
|
||||
Surface.ROTATION_0)
|
||||
statusBarLayerRotatesScales(configuration.startRotation,
|
||||
Surface.ROTATION_0)
|
||||
navBarLayerIsAlwaysVisible()
|
||||
statusBarLayerIsAlwaysVisible()
|
||||
visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||
listOf(IME_WINDOW_TITLE))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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())
|
||||
|
||||
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))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user