Merge "Update IME tests to new DSL format" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-02-09 08:44:42 +00:00
committed by Android (Google) Code Review
7 changed files with 240 additions and 204 deletions

View File

@@ -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,26 +85,39 @@ class CloseImeAutoOpenWindowToAppTest(
testApp.closeIME(device, wmHelper) testApp.closeIME(device, wmHelper)
} }
assertions { assertions {
windowManagerTrace { val isRotated = configuration.startRotation.isRotated()
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod"))
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 { flaky {
navBarLayerIsAlwaysVisible() layersTrace {
statusBarLayerIsAlwaysVisible() visibleLayersShownMoreThanOneConsecutiveEntry()
noUncoveredRegions(configuration.startRotation)
navBarLayerRotatesAndScales(configuration.startRotation,
enabled = !configuration.startRotation.isRotated())
statusBarLayerRotatesScales(configuration.startRotation,
enabled = !configuration.startRotation.isRotated())
visibleLayersShownMoreThanOneConsecutiveEntry()
imeLayerBecomesInvisible() if (isRotated) {
imeAppLayerIsAlwaysVisible(testApp) navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
}
}
} }
} }
} }

View File

@@ -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,32 +88,50 @@ class CloseImeAutoOpenWindowToHomeTest(
wmHelper.waitImeWindowGone() wmHelper.waitImeWindowGone()
} }
assertions { assertions {
windowManagerTrace { val isRotated = configuration.startRotation.isRotated()
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
imeWindowBecomesInvisible() presubmit {
imeAppWindowBecomesInvisible(testApp) 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 { flaky {
noUncoveredRegions(configuration.startRotation, Surface.ROTATION_0) layersTrace {
navBarLayerRotatesAndScales(configuration.startRotation, if (isRotated) {
Surface.ROTATION_0, navBarLayerRotatesAndScales(configuration.startRotation,
enabled = !configuration.startRotation.isRotated()) Surface.ROTATION_0)
statusBarLayerRotatesScales(configuration.startRotation, statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0, Surface.ROTATION_0)
enabled = !configuration.startRotation.isRotated()) navBarLayerIsAlwaysVisible()
navBarLayerIsAlwaysVisible( statusBarLayerIsAlwaysVisible()
enabled = !configuration.startRotation.isRotated()) visibleLayersShownMoreThanOneConsecutiveEntry(
statusBarLayerIsAlwaysVisible( listOf(IME_WINDOW_TITLE))
enabled = !configuration.startRotation.isRotated()) }
visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE), }
enabled = !configuration.startRotation.isRotated())
imeLayerBecomesInvisible()
imeAppLayerBecomesInvisible(testApp)
} }
} }
} }

View File

@@ -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,24 +82,25 @@ class CloseImeWindowToAppTest(
testApp.closeIME(device, wmHelper) testApp.closeIME(device, wmHelper)
} }
assertions { assertions {
windowManagerTrace { postsubmit {
navBarWindowIsAlwaysVisible() windowManagerTrace {
statusBarWindowIsAlwaysVisible() navBarWindowIsAlwaysVisible()
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod")) statusBarWindowIsAlwaysVisible()
visibleWindowsShownMoreThanOneConsecutiveEntry(
listOf(IME_WINDOW_TITLE))
imeAppWindowIsAlwaysVisible(testApp)
}
imeAppWindowIsAlwaysVisible(testApp) layersTrace {
} navBarLayerIsAlwaysVisible()
statusBarLayerIsAlwaysVisible()
layersTrace { noUncoveredRegions(configuration.startRotation)
navBarLayerIsAlwaysVisible() navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerIsAlwaysVisible() statusBarLayerRotatesScales(configuration.startRotation)
noUncoveredRegions(configuration.startRotation) visibleLayersShownMoreThanOneConsecutiveEntry()
navBarLayerRotatesAndScales(configuration.startRotation) imeLayerBecomesInvisible()
statusBarLayerRotatesScales(configuration.startRotation) imeAppLayerIsAlwaysVisible(testApp)
visibleLayersShownMoreThanOneConsecutiveEntry() }
imeLayerBecomesInvisible()
imeAppLayerIsAlwaysVisible(testApp)
} }
} }
} }

View File

@@ -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 {
windowManagerTrace { val isRotated = configuration.startRotation.isRotated()
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
imeWindowBecomesInvisible() postsubmit {
imeAppWindowBecomesInvisible(testApp) 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 { flaky {
noUncoveredRegions(configuration.startRotation, layersTrace {
Surface.ROTATION_0) visibleLayersShownMoreThanOneConsecutiveEntry(
navBarLayerRotatesAndScales(configuration.startRotation, listOf(IME_WINDOW_TITLE))
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)
imeLayerBecomesInvisible() if (isRotated) {
imeAppLayerBecomesInvisible(testApp) navBarLayerRotatesAndScales(configuration.startRotation,
Surface.ROTATION_0)
statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0)
}
}
} }
} }
} }

View File

@@ -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()

View File

@@ -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,27 +84,43 @@ class OpenImeWindowTest(
} }
} }
assertions { assertions {
windowManagerTrace { val isRotated = configuration.startRotation.isRotated()
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
visibleWindowsShownMoreThanOneConsecutiveEntry()
imeWindowBecomesVisible() postsubmit {
appWindowAlwaysVisibleOnTop(testApp.`package`) 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 { flaky {
navBarLayerIsAlwaysVisible() windowManagerTrace {
statusBarLayerIsAlwaysVisible() visibleWindowsShownMoreThanOneConsecutiveEntry()
noUncoveredRegions(configuration.startRotation) }
navBarLayerRotatesAndScales(configuration.startRotation, layersTrace {
enabled = !configuration.startRotation.isRotated()) visibleLayersShownMoreThanOneConsecutiveEntry()
statusBarLayerRotatesScales(configuration.startRotation,
enabled = !configuration.startRotation.isRotated())
visibleLayersShownMoreThanOneConsecutiveEntry()
imeLayerBecomesVisible() if (isRotated) {
layerAlwaysVisible(testApp.`package`) navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
}
}
} }
} }
} }

View File

@@ -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)
@@ -67,34 +65,37 @@ class ReOpenImeWindowTest(
val testAppComponentName = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME val testAppComponentName = ActivityOptions.IME_ACTIVITY_AUTO_FOCUS_COMPONENT_NAME
return FlickerTestRunnerFactory.getInstance() return FlickerTestRunnerFactory.getInstance()
.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 {
device.wakeUpAndGoToHomeScreen() device.wakeUpAndGoToHomeScreen()
testApp.launchViaIntent(wmHelper) testApp.launchViaIntent(wmHelper)
testApp.openIME(device, wmHelper) testApp.openIME(device, wmHelper)
}
eachRun {
device.pressRecentApps()
wmHelper.waitImeWindowGone()
wmHelper.waitForAppTransitionIdle()
this.setRotation(configuration.startRotation)
}
} }
transitions { eachRun {
device.reopenAppFromOverview() device.pressRecentApps()
wmHelper.waitImeWindowShown() wmHelper.waitImeWindowGone()
wmHelper.waitForAppTransitionIdle()
this.setRotation(configuration.startRotation)
} }
teardown { }
test { transitions {
this.setRotation(Surface.ROTATION_0) device.reopenAppFromOverview()
testApp.exit() wmHelper.waitImeWindowShown()
} }
teardown {
test {
this.setRotation(Surface.ROTATION_0)
testApp.exit()
} }
assertions { }
assertions {
val isRotated = configuration.startRotation.isRotated()
presubmit {
windowManagerTrace { windowManagerTrace {
navBarWindowIsAlwaysVisible() navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible() statusBarWindowIsAlwaysVisible()
@@ -107,21 +108,34 @@ 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)
}
} }
} }
} }
}
} }
} }
} }