Merge "Update Close App tests to new DSL format" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6a7f2d9e95
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.android.server.wm.flicker.close
|
package com.android.server.wm.flicker.close
|
||||||
|
|
||||||
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,7 +49,6 @@ import org.junit.runners.Parameterized
|
|||||||
* Test app closes by pressing back button
|
* Test app closes by pressing back button
|
||||||
* To run this test: `atest FlickerTests:CloseAppBackButtonTest`
|
* To run this test: `atest FlickerTests:CloseAppBackButtonTest`
|
||||||
*/
|
*/
|
||||||
@Presubmit
|
|
||||||
@RequiresDevice
|
@RequiresDevice
|
||||||
@RunWith(Parameterized::class)
|
@RunWith(Parameterized::class)
|
||||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||||
@@ -65,7 +63,7 @@ class CloseAppBackButtonTest(
|
|||||||
val testApp = SimpleAppHelper(instrumentation)
|
val testApp = SimpleAppHelper(instrumentation)
|
||||||
return FlickerTestRunnerFactory.getInstance()
|
return FlickerTestRunnerFactory.getInstance()
|
||||||
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
||||||
withTestName { buildTestTag("closeAppBackButton", configuration) }
|
withTestName { buildTestTag(configuration) }
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
test {
|
test {
|
||||||
@@ -89,29 +87,47 @@ class CloseAppBackButtonTest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
windowManagerTrace {
|
val isRotated = configuration.startRotation.isRotated()
|
||||||
navBarWindowIsAlwaysVisible()
|
|
||||||
statusBarWindowIsAlwaysVisible()
|
|
||||||
visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173684672)
|
|
||||||
|
|
||||||
launcherReplacesAppWindowAsTopWindow(testApp)
|
presubmit {
|
||||||
wallpaperWindowBecomesVisible()
|
windowManagerTrace {
|
||||||
|
navBarWindowIsAlwaysVisible()
|
||||||
|
statusBarWindowIsAlwaysVisible()
|
||||||
|
launcherReplacesAppWindowAsTopWindow(testApp)
|
||||||
|
wallpaperWindowBecomesVisible()
|
||||||
|
}
|
||||||
|
|
||||||
|
layersTrace {
|
||||||
|
noUncoveredRegions(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
navBarLayerIsAlwaysVisible()
|
||||||
|
statusBarLayerIsAlwaysVisible()
|
||||||
|
wallpaperLayerReplacesAppLayer(testApp)
|
||||||
|
|
||||||
|
if (!isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
layersTrace {
|
flaky {
|
||||||
noUncoveredRegions(configuration.startRotation,
|
windowManagerTrace {
|
||||||
Surface.ROTATION_0)
|
visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173684672)
|
||||||
navBarLayerRotatesAndScales(configuration.startRotation,
|
}
|
||||||
Surface.ROTATION_0,
|
|
||||||
enabled = !configuration.startRotation.isRotated())
|
|
||||||
statusBarLayerRotatesScales(configuration.startRotation,
|
|
||||||
Surface.ROTATION_0,
|
|
||||||
enabled = !configuration.startRotation.isRotated())
|
|
||||||
navBarLayerIsAlwaysVisible()
|
|
||||||
statusBarLayerIsAlwaysVisible()
|
|
||||||
visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173684672)
|
|
||||||
|
|
||||||
wallpaperLayerReplacesAppLayer(testApp)
|
layersTrace {
|
||||||
|
visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173684672)
|
||||||
|
|
||||||
|
if (isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEn
|
|||||||
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
|
import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
|
||||||
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
|
||||||
import com.android.server.wm.flicker.helpers.buildTestTag
|
import com.android.server.wm.flicker.helpers.buildTestTag
|
||||||
|
import com.android.server.wm.flicker.helpers.isRotated
|
||||||
import com.android.server.wm.flicker.helpers.setRotation
|
import com.android.server.wm.flicker.helpers.setRotation
|
||||||
import com.android.server.wm.flicker.repetitions
|
import com.android.server.wm.flicker.repetitions
|
||||||
import com.android.server.wm.flicker.startRotation
|
import com.android.server.wm.flicker.startRotation
|
||||||
@@ -64,7 +65,7 @@ class CloseAppHomeButtonTest(
|
|||||||
val testApp = SimpleAppHelper(instrumentation)
|
val testApp = SimpleAppHelper(instrumentation)
|
||||||
return FlickerTestRunnerFactory.getInstance()
|
return FlickerTestRunnerFactory.getInstance()
|
||||||
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
.buildTest(instrumentation, repetitions = 5) { configuration ->
|
||||||
withTestName { buildTestTag("closeAppHomeButton", configuration) }
|
withTestName { buildTestTag(configuration) }
|
||||||
repeat { configuration.repetitions }
|
repeat { configuration.repetitions }
|
||||||
setup {
|
setup {
|
||||||
test {
|
test {
|
||||||
@@ -88,28 +89,46 @@ class CloseAppHomeButtonTest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertions {
|
assertions {
|
||||||
windowManagerTrace {
|
val isRotated = configuration.startRotation.isRotated()
|
||||||
navBarWindowIsAlwaysVisible()
|
|
||||||
statusBarWindowIsAlwaysVisible()
|
|
||||||
visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173689015)
|
|
||||||
|
|
||||||
launcherReplacesAppWindowAsTopWindow(testApp)
|
presubmit {
|
||||||
wallpaperWindowBecomesVisible()
|
windowManagerTrace {
|
||||||
|
navBarWindowIsAlwaysVisible()
|
||||||
|
statusBarWindowIsAlwaysVisible()
|
||||||
|
launcherReplacesAppWindowAsTopWindow(testApp)
|
||||||
|
wallpaperWindowBecomesVisible()
|
||||||
|
}
|
||||||
|
|
||||||
|
layersTrace {
|
||||||
|
noUncoveredRegions(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
navBarLayerIsAlwaysVisible()
|
||||||
|
statusBarLayerIsAlwaysVisible()
|
||||||
|
wallpaperLayerReplacesAppLayer(testApp)
|
||||||
|
|
||||||
|
if (!isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
layersTrace {
|
flaky {
|
||||||
val isRotation0 = configuration.startRotation == Surface.ROTATION_0
|
windowManagerTrace {
|
||||||
noUncoveredRegions(configuration.startRotation,
|
visibleWindowsShownMoreThanOneConsecutiveEntry(bugId = 173689015)
|
||||||
Surface.ROTATION_0)
|
}
|
||||||
navBarLayerRotatesAndScales(configuration.startRotation,
|
layersTrace {
|
||||||
Surface.ROTATION_0, enabled = isRotation0)
|
visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173689015)
|
||||||
statusBarLayerRotatesScales(configuration.startRotation,
|
|
||||||
Surface.ROTATION_0, enabled = isRotation0)
|
|
||||||
navBarLayerIsAlwaysVisible()
|
|
||||||
statusBarLayerIsAlwaysVisible()
|
|
||||||
visibleLayersShownMoreThanOneConsecutiveEntry(bugId = 173689015)
|
|
||||||
|
|
||||||
wallpaperLayerReplacesAppLayer(testApp)
|
if (isRotated) {
|
||||||
|
navBarLayerRotatesAndScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
statusBarLayerRotatesScales(configuration.startRotation,
|
||||||
|
Surface.ROTATION_0)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user