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
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import androidx.test.filters.FlakyTest
|
|
||||||
import android.platform.test.annotations.Presubmit
|
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import androidx.test.filters.RequiresDevice
|
import androidx.test.filters.RequiresDevice
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
@@ -48,11 +46,9 @@ import org.junit.runners.Parameterized
|
|||||||
* Test IME window closing back to app window transitions.
|
* Test IME window closing back to app window transitions.
|
||||||
* To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToAppTest`
|
* To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToAppTest`
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@RunWith(Parameterized::class)
|
@RunWith(Parameterized::class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@FlakyTest(bugId = 178015460)
|
|
||||||
class CloseImeAutoOpenWindowToAppTest(
|
class CloseImeAutoOpenWindowToAppTest(
|
||||||
testSpec: FlickerTestRunnerFactory.TestSpec
|
testSpec: FlickerTestRunnerFactory.TestSpec
|
||||||
) : FlickerTestRunner(testSpec) {
|
) : FlickerTestRunner(testSpec) {
|
||||||
@@ -66,7 +62,7 @@ class CloseImeAutoOpenWindowToAppTest(
|
|||||||
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
||||||
val testApp = ImeAppAutoFocusHelper(instrumentation,
|
val testApp = ImeAppAutoFocusHelper(instrumentation,
|
||||||
configuration.startRotation)
|
configuration.startRotation)
|
||||||
withTestName { buildTestTag("imeToAppAutoOpen", configuration) }
|
withTestName { buildTestTag(configuration) }
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
test {
|
test {
|
||||||
@@ -89,11 +85,14 @@ class CloseImeAutoOpenWindowToAppTest(
|
|||||||
testApp.closeIME(device, wmHelper)
|
testApp.closeIME(device, wmHelper)
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
|
val isRotated = configuration.startRotation.isRotated()
|
||||||
|
|
||||||
|
postsubmit {
|
||||||
windowManagerTrace {
|
windowManagerTrace {
|
||||||
navBarWindowIsAlwaysVisible()
|
navBarWindowIsAlwaysVisible()
|
||||||
statusBarWindowIsAlwaysVisible()
|
statusBarWindowIsAlwaysVisible()
|
||||||
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod"))
|
visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||||
|
listOf(IME_WINDOW_TITLE))
|
||||||
imeAppWindowIsAlwaysVisible(testApp)
|
imeAppWindowIsAlwaysVisible(testApp)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,14 +100,24 @@ class CloseImeAutoOpenWindowToAppTest(
|
|||||||
navBarLayerIsAlwaysVisible()
|
navBarLayerIsAlwaysVisible()
|
||||||
statusBarLayerIsAlwaysVisible()
|
statusBarLayerIsAlwaysVisible()
|
||||||
noUncoveredRegions(configuration.startRotation)
|
noUncoveredRegions(configuration.startRotation)
|
||||||
navBarLayerRotatesAndScales(configuration.startRotation,
|
|
||||||
enabled = !configuration.startRotation.isRotated())
|
|
||||||
statusBarLayerRotatesScales(configuration.startRotation,
|
|
||||||
enabled = !configuration.startRotation.isRotated())
|
|
||||||
visibleLayersShownMoreThanOneConsecutiveEntry()
|
|
||||||
|
|
||||||
imeLayerBecomesInvisible()
|
imeLayerBecomesInvisible()
|
||||||
imeAppLayerIsAlwaysVisible(testApp)
|
imeAppLayerIsAlwaysVisible(testApp)
|
||||||
|
if (!isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flaky {
|
||||||
|
layersTrace {
|
||||||
|
visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||||
|
|
||||||
|
if (isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.ime
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit
|
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import androidx.test.filters.RequiresDevice
|
import androidx.test.filters.RequiresDevice
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
@@ -47,7 +46,6 @@ import org.junit.runners.Parameterized
|
|||||||
* Test IME window closing back to app window transitions.
|
* Test IME window closing back to app window transitions.
|
||||||
* To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToHomeTest`
|
* To run this test: `atest FlickerTests:CloseImeAutoOpenWindowToHomeTest`
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@RunWith(Parameterized::class)
|
@RunWith(Parameterized::class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@@ -65,7 +63,7 @@ class CloseImeAutoOpenWindowToHomeTest(
|
|||||||
val testApp = ImeAppAutoFocusHelper(instrumentation,
|
val testApp = ImeAppAutoFocusHelper(instrumentation,
|
||||||
configuration.startRotation)
|
configuration.startRotation)
|
||||||
withTestName {
|
withTestName {
|
||||||
buildTestTag("imeToHomeAutoOpen", configuration)
|
buildTestTag(configuration)
|
||||||
}
|
}
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
@@ -90,10 +88,14 @@ class CloseImeAutoOpenWindowToHomeTest(
|
|||||||
wmHelper.waitImeWindowGone()
|
wmHelper.waitImeWindowGone()
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
|
val isRotated = configuration.startRotation.isRotated()
|
||||||
|
|
||||||
|
presubmit {
|
||||||
windowManagerTrace {
|
windowManagerTrace {
|
||||||
navBarWindowIsAlwaysVisible()
|
navBarWindowIsAlwaysVisible()
|
||||||
statusBarWindowIsAlwaysVisible()
|
statusBarWindowIsAlwaysVisible()
|
||||||
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
|
visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||||
|
listOf(IME_WINDOW_TITLE))
|
||||||
|
|
||||||
imeWindowBecomesInvisible()
|
imeWindowBecomesInvisible()
|
||||||
imeAppWindowBecomesInvisible(testApp)
|
imeAppWindowBecomesInvisible(testApp)
|
||||||
@@ -101,21 +103,35 @@ class CloseImeAutoOpenWindowToHomeTest(
|
|||||||
|
|
||||||
layersTrace {
|
layersTrace {
|
||||||
noUncoveredRegions(configuration.startRotation, Surface.ROTATION_0)
|
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()
|
imeLayerBecomesInvisible()
|
||||||
imeAppLayerBecomesInvisible(testApp)
|
imeAppLayerBecomesInvisible(testApp)
|
||||||
|
|
||||||
|
if (!isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
navBarLayerIsAlwaysVisible()
|
||||||
|
statusBarLayerIsAlwaysVisible()
|
||||||
|
visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||||
|
listOf(IME_WINDOW_TITLE))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import androidx.test.filters.FlakyTest
|
|
||||||
import android.platform.test.annotations.Presubmit
|
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import androidx.test.filters.RequiresDevice
|
import androidx.test.filters.RequiresDevice
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
@@ -47,11 +45,9 @@ import org.junit.runners.Parameterized
|
|||||||
* Test IME window closing back to app window transitions.
|
* Test IME window closing back to app window transitions.
|
||||||
* To run this test: `atest FlickerTests:CloseImeWindowToAppTest`
|
* To run this test: `atest FlickerTests:CloseImeWindowToAppTest`
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@RunWith(Parameterized::class)
|
@RunWith(Parameterized::class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@FlakyTest(bugId = 178015460)
|
|
||||||
class CloseImeWindowToAppTest(
|
class CloseImeWindowToAppTest(
|
||||||
testSpec: FlickerTestRunnerFactory.TestSpec
|
testSpec: FlickerTestRunnerFactory.TestSpec
|
||||||
) : FlickerTestRunner(testSpec) {
|
) : FlickerTestRunner(testSpec) {
|
||||||
@@ -64,7 +60,7 @@ class CloseImeWindowToAppTest(
|
|||||||
val testApp = ImeAppHelper(instrumentation)
|
val testApp = ImeAppHelper(instrumentation)
|
||||||
return FlickerTestRunnerFactory.getInstance()
|
return FlickerTestRunnerFactory.getInstance()
|
||||||
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
||||||
withTestName { buildTestTag("imeToApp", configuration) }
|
withTestName { buildTestTag(configuration) }
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
test {
|
test {
|
||||||
@@ -86,11 +82,12 @@ class CloseImeWindowToAppTest(
|
|||||||
testApp.closeIME(device, wmHelper)
|
testApp.closeIME(device, wmHelper)
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
|
postsubmit {
|
||||||
windowManagerTrace {
|
windowManagerTrace {
|
||||||
navBarWindowIsAlwaysVisible()
|
navBarWindowIsAlwaysVisible()
|
||||||
statusBarWindowIsAlwaysVisible()
|
statusBarWindowIsAlwaysVisible()
|
||||||
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod"))
|
visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||||
|
listOf(IME_WINDOW_TITLE))
|
||||||
imeAppWindowIsAlwaysVisible(testApp)
|
imeAppWindowIsAlwaysVisible(testApp)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +98,6 @@ class CloseImeWindowToAppTest(
|
|||||||
navBarLayerRotatesAndScales(configuration.startRotation)
|
navBarLayerRotatesAndScales(configuration.startRotation)
|
||||||
statusBarLayerRotatesScales(configuration.startRotation)
|
statusBarLayerRotatesScales(configuration.startRotation)
|
||||||
visibleLayersShownMoreThanOneConsecutiveEntry()
|
visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||||
|
|
||||||
imeLayerBecomesInvisible()
|
imeLayerBecomesInvisible()
|
||||||
imeAppLayerIsAlwaysVisible(testApp)
|
imeAppLayerIsAlwaysVisible(testApp)
|
||||||
}
|
}
|
||||||
@@ -109,4 +105,5 @@ class CloseImeWindowToAppTest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.ime
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import androidx.test.filters.FlakyTest
|
|
||||||
import android.platform.test.annotations.Presubmit
|
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import androidx.test.filters.RequiresDevice
|
import androidx.test.filters.RequiresDevice
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
@@ -47,11 +45,9 @@ import org.junit.runners.Parameterized
|
|||||||
* Test IME window closing to home transitions.
|
* Test IME window closing to home transitions.
|
||||||
* To run this test: `atest FlickerTests:CloseImeWindowToHomeTest`
|
* To run this test: `atest FlickerTests:CloseImeWindowToHomeTest`
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@RunWith(Parameterized::class)
|
@RunWith(Parameterized::class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@FlakyTest(bugId = 178015460)
|
|
||||||
class CloseImeWindowToHomeTest(
|
class CloseImeWindowToHomeTest(
|
||||||
testSpec: FlickerTestRunnerFactory.TestSpec
|
testSpec: FlickerTestRunnerFactory.TestSpec
|
||||||
) : FlickerTestRunner(testSpec) {
|
) : FlickerTestRunner(testSpec) {
|
||||||
@@ -63,7 +59,7 @@ class CloseImeWindowToHomeTest(
|
|||||||
val testApp = ImeAppHelper(instrumentation)
|
val testApp = ImeAppHelper(instrumentation)
|
||||||
return FlickerTestRunnerFactory.getInstance()
|
return FlickerTestRunnerFactory.getInstance()
|
||||||
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
||||||
withTestName { buildTestTag("imeToHome", configuration) }
|
withTestName { buildTestTag(configuration) }
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
test {
|
test {
|
||||||
@@ -91,31 +87,47 @@ class CloseImeWindowToHomeTest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
|
val isRotated = configuration.startRotation.isRotated()
|
||||||
|
|
||||||
|
postsubmit {
|
||||||
windowManagerTrace {
|
windowManagerTrace {
|
||||||
navBarWindowIsAlwaysVisible()
|
navBarWindowIsAlwaysVisible()
|
||||||
statusBarWindowIsAlwaysVisible()
|
statusBarWindowIsAlwaysVisible()
|
||||||
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
|
visibleWindowsShownMoreThanOneConsecutiveEntry(
|
||||||
|
listOf(IME_WINDOW_TITLE))
|
||||||
imeWindowBecomesInvisible()
|
imeWindowBecomesInvisible()
|
||||||
imeAppWindowBecomesInvisible(testApp)
|
imeAppWindowBecomesInvisible(testApp)
|
||||||
}
|
}
|
||||||
|
|
||||||
layersTrace {
|
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()
|
navBarLayerIsAlwaysVisible()
|
||||||
statusBarLayerIsAlwaysVisible()
|
statusBarLayerIsAlwaysVisible()
|
||||||
visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE),
|
|
||||||
enabled = false)
|
|
||||||
|
|
||||||
imeLayerBecomesInvisible()
|
imeLayerBecomesInvisible()
|
||||||
imeAppLayerBecomesInvisible(testApp)
|
imeAppLayerBecomesInvisible(testApp)
|
||||||
|
noUncoveredRegions(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
|
||||||
|
if (!isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flaky {
|
||||||
|
layersTrace {
|
||||||
|
visibleLayersShownMoreThanOneConsecutiveEntry(
|
||||||
|
listOf(IME_WINDOW_TITLE))
|
||||||
|
|
||||||
|
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
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import android.platform.helpers.IAppHelper
|
import android.platform.helpers.IAppHelper
|
||||||
import com.android.server.wm.flicker.dsl.LayersAssertionBuilderLegacy
|
import com.android.server.wm.flicker.dsl.LayersAssertionBuilder
|
||||||
import com.android.server.wm.flicker.dsl.WmAssertionBuilderLegacy
|
import com.android.server.wm.flicker.dsl.WmAssertionBuilder
|
||||||
|
|
||||||
const val IME_WINDOW_TITLE = "InputMethod"
|
const val IME_WINDOW_TITLE = "InputMethod"
|
||||||
|
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
fun LayersAssertionBuilderLegacy.imeLayerBecomesVisible(
|
fun LayersAssertionBuilder.imeLayerBecomesVisible(bugId: Int = 0) {
|
||||||
bugId: Int = 0,
|
all("imeLayerBecomesVisible", bugId) {
|
||||||
enabled: Boolean = bugId == 0
|
|
||||||
) {
|
|
||||||
all("imeLayerBecomesVisible", bugId, enabled) {
|
|
||||||
this.hidesLayer(IME_WINDOW_TITLE)
|
this.hidesLayer(IME_WINDOW_TITLE)
|
||||||
.then()
|
.then()
|
||||||
.showsLayer(IME_WINDOW_TITLE)
|
.showsLayer(IME_WINDOW_TITLE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun LayersAssertionBuilderLegacy.imeLayerBecomesInvisible(
|
@JvmOverloads
|
||||||
bugId: Int = 0,
|
fun LayersAssertionBuilder.imeLayerBecomesInvisible(bugId: Int = 0) {
|
||||||
enabled: Boolean = bugId == 0
|
all("imeLayerBecomesInvisible", bugId) {
|
||||||
) {
|
|
||||||
all("imeLayerBecomesInvisible", bugId, enabled) {
|
|
||||||
this.showsLayer(IME_WINDOW_TITLE)
|
this.showsLayer(IME_WINDOW_TITLE)
|
||||||
.then()
|
.then()
|
||||||
.hidesLayer(IME_WINDOW_TITLE)
|
.hidesLayer(IME_WINDOW_TITLE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun LayersAssertionBuilderLegacy.imeAppLayerIsAlwaysVisible(
|
@JvmOverloads
|
||||||
testApp: IAppHelper,
|
fun LayersAssertionBuilder.imeAppLayerIsAlwaysVisible(testApp: IAppHelper, bugId: Int = 0) {
|
||||||
bugId: Int = 0,
|
all("imeAppLayerIsAlwaysVisible", bugId) {
|
||||||
enabled: Boolean = bugId == 0
|
|
||||||
) {
|
|
||||||
all("imeAppLayerIsAlwaysVisible", bugId, enabled) {
|
|
||||||
this.showsLayer(testApp.getPackage())
|
this.showsLayer(testApp.getPackage())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun WmAssertionBuilderLegacy.imeAppWindowIsAlwaysVisible(
|
@JvmOverloads
|
||||||
testApp: IAppHelper,
|
fun WmAssertionBuilder.imeAppWindowIsAlwaysVisible(testApp: IAppHelper, bugId: Int = 0) {
|
||||||
bugId: Int = 0,
|
all("imeAppWindowIsAlwaysVisible", bugId) {
|
||||||
enabled: Boolean = bugId == 0
|
|
||||||
) {
|
|
||||||
all("imeAppWindowIsAlwaysVisible", bugId, enabled) {
|
|
||||||
this.showsAppWindowOnTop(testApp.getPackage())
|
this.showsAppWindowOnTop(testApp.getPackage())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun WmAssertionBuilderLegacy.imeWindowBecomesVisible(
|
@JvmOverloads
|
||||||
bugId: Int = 0,
|
fun WmAssertionBuilder.imeWindowBecomesVisible(bugId: Int = 0) {
|
||||||
enabled: Boolean = bugId == 0
|
all("imeWindowBecomesVisible", bugId) {
|
||||||
) {
|
|
||||||
all("imeWindowBecomesVisible", bugId, enabled) {
|
|
||||||
this.hidesNonAppWindow(IME_WINDOW_TITLE)
|
this.hidesNonAppWindow(IME_WINDOW_TITLE)
|
||||||
.then()
|
.then()
|
||||||
.showsNonAppWindow(IME_WINDOW_TITLE)
|
.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun WmAssertionBuilderLegacy.imeWindowBecomesInvisible(
|
@JvmOverloads
|
||||||
bugId: Int = 0,
|
fun WmAssertionBuilder.imeWindowBecomesInvisible(bugId: Int = 0) {
|
||||||
enabled: Boolean = bugId == 0
|
all("imeWindowBecomesInvisible", bugId) {
|
||||||
) {
|
|
||||||
all("imeWindowBecomesInvisible", bugId, enabled) {
|
|
||||||
this.showsNonAppWindow(IME_WINDOW_TITLE)
|
this.showsNonAppWindow(IME_WINDOW_TITLE)
|
||||||
.then()
|
.then()
|
||||||
.hidesNonAppWindow(IME_WINDOW_TITLE)
|
.hidesNonAppWindow(IME_WINDOW_TITLE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun WmAssertionBuilderLegacy.imeAppWindowBecomesVisible(
|
@JvmOverloads
|
||||||
windowName: String,
|
fun WmAssertionBuilder.imeAppWindowBecomesVisible(windowName: String, bugId: Int = 0) {
|
||||||
bugId: Int = 0,
|
all("imeAppWindowBecomesVisible", bugId) {
|
||||||
enabled: Boolean = bugId == 0
|
|
||||||
) {
|
|
||||||
all("imeAppWindowBecomesVisible", bugId, enabled) {
|
|
||||||
this.hidesAppWindow(windowName)
|
this.hidesAppWindow(windowName)
|
||||||
.then()
|
.then()
|
||||||
.showsAppWindow(windowName)
|
.showsAppWindow(windowName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun WmAssertionBuilderLegacy.imeAppWindowBecomesInvisible(
|
@JvmOverloads
|
||||||
testApp: IAppHelper,
|
fun WmAssertionBuilder.imeAppWindowBecomesInvisible(testApp: IAppHelper, bugId: Int = 0) {
|
||||||
bugId: Int = 0,
|
all("imeAppWindowBecomesInvisible", bugId) {
|
||||||
enabled: Boolean = bugId == 0
|
|
||||||
) {
|
|
||||||
all("imeAppWindowBecomesInvisible", bugId, enabled) {
|
|
||||||
this.showsAppWindowOnTop(testApp.getPackage())
|
this.showsAppWindowOnTop(testApp.getPackage())
|
||||||
.then()
|
.then()
|
||||||
.appWindowNotOnTop(testApp.getPackage())
|
.appWindowNotOnTop(testApp.getPackage())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun LayersAssertionBuilderLegacy.imeAppLayerBecomesInvisible(
|
@JvmOverloads
|
||||||
testApp: IAppHelper,
|
fun LayersAssertionBuilder.imeAppLayerBecomesInvisible(testApp: IAppHelper, bugId: Int = 0) {
|
||||||
bugId: Int = 0,
|
all("imeAppLayerBecomesInvisible", bugId) {
|
||||||
enabled: Boolean = bugId == 0
|
|
||||||
) {
|
|
||||||
all("imeAppLayerBecomesInvisible", bugId, enabled) {
|
|
||||||
this.skipUntilFirstAssertion()
|
this.skipUntilFirstAssertion()
|
||||||
.showsLayer(testApp.getPackage())
|
.showsLayer(testApp.getPackage())
|
||||||
.then()
|
.then()
|
||||||
|
|||||||
@@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.ime
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import androidx.test.filters.FlakyTest
|
|
||||||
import android.platform.test.annotations.Presubmit
|
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import androidx.test.filters.RequiresDevice
|
import androidx.test.filters.RequiresDevice
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
@@ -50,11 +48,9 @@ import org.junit.runners.Parameterized
|
|||||||
* Test IME window opening transitions.
|
* Test IME window opening transitions.
|
||||||
* To run this test: `atest FlickerTests:OpenImeWindowTest`
|
* To run this test: `atest FlickerTests:OpenImeWindowTest`
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@RunWith(Parameterized::class)
|
@RunWith(Parameterized::class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@FlakyTest(bugId = 178015460)
|
|
||||||
class OpenImeWindowTest(
|
class OpenImeWindowTest(
|
||||||
testSpec: FlickerTestRunnerFactory.TestSpec
|
testSpec: FlickerTestRunnerFactory.TestSpec
|
||||||
) : FlickerTestRunner(testSpec) {
|
) : FlickerTestRunner(testSpec) {
|
||||||
@@ -66,7 +62,7 @@ class OpenImeWindowTest(
|
|||||||
val testApp = ImeAppHelper(instrumentation)
|
val testApp = ImeAppHelper(instrumentation)
|
||||||
return FlickerTestRunnerFactory.getInstance()
|
return FlickerTestRunnerFactory.getInstance()
|
||||||
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
||||||
withTestName { buildTestTag("openIme", configuration) }
|
withTestName { buildTestTag(configuration) }
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
test {
|
test {
|
||||||
@@ -88,10 +84,12 @@ class OpenImeWindowTest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
|
val isRotated = configuration.startRotation.isRotated()
|
||||||
|
|
||||||
|
postsubmit {
|
||||||
windowManagerTrace {
|
windowManagerTrace {
|
||||||
navBarWindowIsAlwaysVisible()
|
navBarWindowIsAlwaysVisible()
|
||||||
statusBarWindowIsAlwaysVisible()
|
statusBarWindowIsAlwaysVisible()
|
||||||
visibleWindowsShownMoreThanOneConsecutiveEntry()
|
|
||||||
|
|
||||||
imeWindowBecomesVisible()
|
imeWindowBecomesVisible()
|
||||||
appWindowAlwaysVisibleOnTop(testApp.`package`)
|
appWindowAlwaysVisibleOnTop(testApp.`package`)
|
||||||
@@ -101,14 +99,28 @@ class OpenImeWindowTest(
|
|||||||
navBarLayerIsAlwaysVisible()
|
navBarLayerIsAlwaysVisible()
|
||||||
statusBarLayerIsAlwaysVisible()
|
statusBarLayerIsAlwaysVisible()
|
||||||
noUncoveredRegions(configuration.startRotation)
|
noUncoveredRegions(configuration.startRotation)
|
||||||
navBarLayerRotatesAndScales(configuration.startRotation,
|
|
||||||
enabled = !configuration.startRotation.isRotated())
|
|
||||||
statusBarLayerRotatesScales(configuration.startRotation,
|
|
||||||
enabled = !configuration.startRotation.isRotated())
|
|
||||||
visibleLayersShownMoreThanOneConsecutiveEntry()
|
|
||||||
|
|
||||||
imeLayerBecomesVisible()
|
imeLayerBecomesVisible()
|
||||||
layerAlwaysVisible(testApp.`package`)
|
layerAlwaysVisible(testApp.`package`)
|
||||||
|
|
||||||
|
if (!isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flaky {
|
||||||
|
windowManagerTrace {
|
||||||
|
visibleWindowsShownMoreThanOneConsecutiveEntry()
|
||||||
|
}
|
||||||
|
layersTrace {
|
||||||
|
visibleLayersShownMoreThanOneConsecutiveEntry()
|
||||||
|
|
||||||
|
if (isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.ime
|
package com.android.server.wm.flicker.ime
|
||||||
|
|
||||||
import android.platform.test.annotations.Presubmit
|
|
||||||
import android.view.Surface
|
import android.view.Surface
|
||||||
import androidx.test.filters.RequiresDevice
|
import androidx.test.filters.RequiresDevice
|
||||||
import androidx.test.platform.app.InstrumentationRegistry
|
import androidx.test.platform.app.InstrumentationRegistry
|
||||||
@@ -52,7 +51,6 @@ import org.junit.runners.Parameterized
|
|||||||
* Test IME window opening transitions.
|
* Test IME window opening transitions.
|
||||||
* To run this test: `atest FlickerTests:ReOpenImeWindowTest`
|
* To run this test: `atest FlickerTests:ReOpenImeWindowTest`
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@RunWith(Parameterized::class)
|
@RunWith(Parameterized::class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@@ -69,7 +67,7 @@ class ReOpenImeWindowTest(
|
|||||||
.buildTest(instrumentation, repetitions = 1) { configuration ->
|
.buildTest(instrumentation, repetitions = 1) { configuration ->
|
||||||
val testApp = ImeAppAutoFocusHelper(instrumentation,
|
val testApp = ImeAppAutoFocusHelper(instrumentation,
|
||||||
configuration.startRotation)
|
configuration.startRotation)
|
||||||
withTestName { buildTestTag("reOpenImeAutoFocus", configuration) }
|
withTestName { buildTestTag(configuration) }
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
test {
|
test {
|
||||||
@@ -95,6 +93,9 @@ class ReOpenImeWindowTest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
|
val isRotated = configuration.startRotation.isRotated()
|
||||||
|
|
||||||
|
presubmit {
|
||||||
windowManagerTrace {
|
windowManagerTrace {
|
||||||
navBarWindowIsAlwaysVisible()
|
navBarWindowIsAlwaysVisible()
|
||||||
statusBarWindowIsAlwaysVisible()
|
statusBarWindowIsAlwaysVisible()
|
||||||
@@ -107,18 +108,31 @@ class ReOpenImeWindowTest(
|
|||||||
|
|
||||||
layersTrace {
|
layersTrace {
|
||||||
noUncoveredRegions(Surface.ROTATION_0, configuration.endRotation)
|
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()
|
statusBarLayerIsAlwaysVisible()
|
||||||
navBarLayerIsAlwaysVisible()
|
navBarLayerIsAlwaysVisible()
|
||||||
visibleLayersShownMoreThanOneConsecutiveEntry(enabled = false)
|
|
||||||
|
|
||||||
imeLayerBecomesVisible()
|
imeLayerBecomesVisible()
|
||||||
appLayerReplacesWallpaperLayer(testAppComponentName.className)
|
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