Revert "Use SysUI TAPL on flicker to fix lock screen tests"

This reverts commit 5f24cc2a1f.

Reason for revert: b/243939100

Change-Id: I56fb0b515fc1d07c09f1e00c3a2856cc3d428239
This commit is contained in:
Vinit Nayak
2022-08-26 17:00:23 +00:00
parent 5f24cc2a1f
commit 39a46ac29a
8 changed files with 23 additions and 55 deletions

View File

@@ -45,8 +45,6 @@ android_test {
"app-helpers-core",
"launcher-helper-lib",
"launcher-aosp-tapl",
"systemui-tapl",
"systemui-helper",
"wm-flicker-common-assertions",
"wm-flicker-common-app-helpers",
"platform-test-annotations",

View File

@@ -16,7 +16,6 @@
package com.android.wm.shell.flicker.bubble
import android.platform.systemui_tapl.controller.LockscreenController
import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
@@ -47,23 +46,18 @@ import org.junit.runners.Parameterized
@Group4
class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
private val lockScreen = LockscreenController.get()
/** {@inheritDoc} */
override val transition: FlickerBuilder.() -> Unit
get() = buildTransition {
setup {
test {
lockScreen.setUnlockSwipe()
}
eachRun {
val addBubbleBtn = waitAndGetAddBubbleBtn()
addBubbleBtn?.click() ?: error("Bubble widget not found")
lockScreen.lockScreen()
device.sleep()
wmHelper.StateSyncBuilder()
.withKeyguardShowing()
.withoutTopVisibleAppWindows()
.waitForAndVerify()
lockScreen.turnScreenOn()
device.wakeUp()
}
}
transitions {
@@ -76,7 +70,8 @@ class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScr
or WindowInsets.Type.displayCutout()
)
device.swipe(100, insets.top + 100, 100, device.displayHeight / 2, 4)
wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify()
device.waitForIdle(2000)
instrumentation.uiAutomation.syncInputTransactions()
val notification = device.wait(
Until.findObject(
@@ -84,14 +79,14 @@ class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScr
), FIND_OBJECT_TIMEOUT
)
notification?.click() ?: error("Notification not found")
wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify()
instrumentation.uiAutomation.syncInputTransactions()
val showBubble = device.wait(
Until.findObject(
By.res("com.android.systemui", "bubble_view")
), FIND_OBJECT_TIMEOUT
)
showBubble?.click() ?: error("Bubble notify not found")
wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify()
instrumentation.uiAutomation.syncInputTransactions()
val cancelAllBtn = waitAndGetCancelAllBtn()
cancelAllBtn?.click() ?: error("Cancel widget not found")
}

View File

@@ -45,8 +45,6 @@ android_test {
"truth-prebuilt",
"launcher-helper-lib",
"launcher-aosp-tapl",
"systemui-tapl",
"systemui-helper",
"platform-test-annotations",
"wm-flicker-window-extensions",
],

View File

@@ -16,7 +16,6 @@
package com.android.server.wm.flicker.launch
import android.platform.systemui_tapl.controller.LockscreenController
import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.RequiresDevice
@@ -51,8 +50,6 @@ import org.junit.runners.Parameterized
open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
OpenAppFromNotificationCold(testSpec) {
private val lockScreen = LockscreenController.get()
override val openingNotificationsFromLockScreen = true
override val transition: FlickerBuilder.() -> Unit
@@ -60,7 +57,7 @@ open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
// Needs to run at start of transition,
// so before the transition defined in super.transition
transitions {
lockScreen.turnScreenOn()
device.wakeUp()
}
super.transition(this)
@@ -68,9 +65,9 @@ open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
// Needs to run at the end of the setup, so after the setup defined in super.transition
setup {
eachRun {
lockScreen.lockScreen()
device.sleep()
wmHelper.StateSyncBuilder()
.withKeyguardShowing()
.withoutTopVisibleAppWindows()
.waitForAndVerify()
}
}

View File

@@ -16,9 +16,9 @@
package com.android.server.wm.flicker.launch
import android.platform.systemui_tapl.controller.LockscreenController
import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
@@ -52,8 +52,6 @@ import org.junit.runners.Parameterized
open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
OpenAppFromNotificationWarm(testSpec) {
private val lockScreen = LockscreenController.get()
override val openingNotificationsFromLockScreen = true
override val transition: FlickerBuilder.() -> Unit
@@ -61,7 +59,7 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
// Needs to run at start of transition,
// so before the transition defined in super.transition
transitions {
lockScreen.turnScreenOn()
device.wakeUp()
}
super.transition(this)
@@ -69,9 +67,9 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
// Needs to run at the end of the setup, so after the setup defined in super.transition
setup {
eachRun {
lockScreen.lockScreen()
device.sleep()
wmHelper.StateSyncBuilder()
.withKeyguardShowing()
.withoutTopVisibleAppWindows()
.waitForAndVerify()
}
}
@@ -195,7 +193,7 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
super.appWindowIsTopWindowAtEnd()
/** {@inheritDoc} */
@Postsubmit
@Presubmit
@Test
override fun appWindowBecomesTopWindow_ShellTransit() =
super.appWindowBecomesTopWindow_ShellTransit()

View File

@@ -16,7 +16,6 @@
package com.android.server.wm.flicker.launch
import android.platform.systemui_tapl.controller.LockscreenController
import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.RequiresDevice
@@ -26,6 +25,7 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.ShowWhenLockedAppHelper
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.traces.common.ComponentNameMatcher
import org.junit.FixMethodOrder
import org.junit.Test
@@ -49,7 +49,6 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
OpenAppFromLockNotificationCold(testSpec) {
private val showWhenLockedApp: ShowWhenLockedAppHelper =
ShowWhenLockedAppHelper(instrumentation)
private val lockScreen = LockscreenController.get()
// Although we are technically still locked here, the overlay app means we should open the
// notification shade as if we were unlocked.
@@ -61,7 +60,7 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
setup {
eachRun {
lockScreen.turnScreenOn()
device.wakeUpAndGoToHomeScreen()
// Launch an activity that is shown when the device is locked
showWhenLockedApp.launchViaIntent(wmHelper)
@@ -69,9 +68,9 @@ class OpenAppFromLockNotificationWithLockOverlayApp(testSpec: FlickerTestParamet
.withFullScreenApp(showWhenLockedApp)
.waitForAndVerify()
lockScreen.lockScreen()
device.sleep()
wmHelper.StateSyncBuilder()
.withKeyguardShowing()
.withoutTopVisibleAppWindows()
.waitForAndVerify()
}
}

View File

@@ -16,7 +16,6 @@
package com.android.server.wm.flicker.launch
import android.platform.systemui_tapl.controller.LockscreenController
import android.platform.test.annotations.FlakyTest
import android.platform.test.annotations.Presubmit
import com.android.server.wm.flicker.FlickerTestParameter
@@ -34,20 +33,16 @@ import org.junit.Test
abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
OpenAppTransition(testSpec) {
protected val lockScreen = LockscreenController.get()
/**
* Defines the transition used to run the test
*/
override val transition: FlickerBuilder.() -> Unit = {
super.transition(this)
setup {
test {
lockScreen.setUnlockSwipe()
}
eachRun {
lockScreen.lockScreen()
device.sleep()
wmHelper.StateSyncBuilder()
.withKeyguardShowing()
.withoutTopVisibleAppWindows()
.waitForAndVerify()
}
}
@@ -96,8 +91,8 @@ abstract class OpenAppFromLockTransition(testSpec: FlickerTestParameter) :
@Presubmit
@Test
fun screenLockedStart() {
testSpec.assertWmStart {
isKeyguardShowing()
testSpec.assertLayersStart {
isEmpty()
}
}

View File

@@ -27,7 +27,6 @@ import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.FlickerServiceCompatible
import com.android.server.wm.flicker.annotation.Group1
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
import com.android.server.wm.flicker.statusBarLayerPositionAtEnd
import com.android.server.wm.traces.common.ComponentNameMatcher
@@ -68,17 +67,6 @@ open class OpenAppNonResizeableTest(testSpec: FlickerTestParameter) :
OpenAppFromLockTransition(testSpec) {
override val testApp = NonResizeableAppHelper(instrumentation)
override val transition: FlickerBuilder.() -> Unit = {
super.transition(this)
setup {
eachRun {
lockScreen.turnScreenOff()
wmHelper.StateSyncBuilder()
.withoutTopVisibleAppWindows()
.waitForAndVerify()
}
}
}
/**
* Checks that the [ComponentMatcher.NAV_BAR] layer starts invisible, becomes visible during
* unlocking animation and remains visible at the end