Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f453452 authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

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

parents c4afa9e7 39a46ac2
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -45,8 +45,6 @@ android_test {
        "app-helpers-core",
        "app-helpers-core",
        "launcher-helper-lib",
        "launcher-helper-lib",
        "launcher-aosp-tapl",
        "launcher-aosp-tapl",
        "systemui-tapl",
        "systemui-helper",
        "wm-flicker-common-assertions",
        "wm-flicker-common-assertions",
        "wm-flicker-common-app-helpers",
        "wm-flicker-common-app-helpers",
        "platform-test-annotations",
        "platform-test-annotations",
+7 −12
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package com.android.wm.shell.flicker.bubble
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.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.Presubmit
@@ -47,23 +46,18 @@ import org.junit.runners.Parameterized
@Group4
@Group4
class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {
class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScreen(testSpec) {


    private val lockScreen = LockscreenController.get()

    /** {@inheritDoc} */
    /** {@inheritDoc} */
    override val transition: FlickerBuilder.() -> Unit
    override val transition: FlickerBuilder.() -> Unit
        get() = buildTransition {
        get() = buildTransition {
            setup {
            setup {
                test {
                    lockScreen.setUnlockSwipe()
                }
                eachRun {
                eachRun {
                    val addBubbleBtn = waitAndGetAddBubbleBtn()
                    val addBubbleBtn = waitAndGetAddBubbleBtn()
                    addBubbleBtn?.click() ?: error("Bubble widget not found")
                    addBubbleBtn?.click() ?: error("Bubble widget not found")
                    lockScreen.lockScreen()
                    device.sleep()
                    wmHelper.StateSyncBuilder()
                    wmHelper.StateSyncBuilder()
                        .withKeyguardShowing()
                        .withoutTopVisibleAppWindows()
                        .waitForAndVerify()
                        .waitForAndVerify()
                    lockScreen.turnScreenOn()
                    device.wakeUp()
                }
                }
            }
            }
            transitions {
            transitions {
@@ -76,7 +70,8 @@ class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScr
                        or WindowInsets.Type.displayCutout()
                        or WindowInsets.Type.displayCutout()
                )
                )
                device.swipe(100, insets.top + 100, 100, device.displayHeight / 2, 4)
                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(
                val notification = device.wait(
                    Until.findObject(
                    Until.findObject(
@@ -84,14 +79,14 @@ class LaunchBubbleFromLockScreen(testSpec: FlickerTestParameter) : BaseBubbleScr
                    ), FIND_OBJECT_TIMEOUT
                    ), FIND_OBJECT_TIMEOUT
                )
                )
                notification?.click() ?: error("Notification not found")
                notification?.click() ?: error("Notification not found")
                wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify()
                instrumentation.uiAutomation.syncInputTransactions()
                val showBubble = device.wait(
                val showBubble = device.wait(
                    Until.findObject(
                    Until.findObject(
                        By.res("com.android.systemui", "bubble_view")
                        By.res("com.android.systemui", "bubble_view")
                    ), FIND_OBJECT_TIMEOUT
                    ), FIND_OBJECT_TIMEOUT
                )
                )
                showBubble?.click() ?: error("Bubble notify not found")
                showBubble?.click() ?: error("Bubble notify not found")
                wmHelper.StateSyncBuilder().withAppTransitionIdle().waitForAndVerify()
                instrumentation.uiAutomation.syncInputTransactions()
                val cancelAllBtn = waitAndGetCancelAllBtn()
                val cancelAllBtn = waitAndGetCancelAllBtn()
                cancelAllBtn?.click() ?: error("Cancel widget not found")
                cancelAllBtn?.click() ?: error("Cancel widget not found")
            }
            }
+0 −2
Original line number Original line Diff line number Diff line
@@ -45,8 +45,6 @@ android_test {
        "truth-prebuilt",
        "truth-prebuilt",
        "launcher-helper-lib",
        "launcher-helper-lib",
        "launcher-aosp-tapl",
        "launcher-aosp-tapl",
        "systemui-tapl",
        "systemui-helper",
        "platform-test-annotations",
        "platform-test-annotations",
        "wm-flicker-window-extensions",
        "wm-flicker-window-extensions",
    ],
    ],
+3 −6
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package com.android.server.wm.flicker.launch
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.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.RequiresDevice
import android.platform.test.annotations.RequiresDevice
@@ -51,8 +50,6 @@ import org.junit.runners.Parameterized
open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
    OpenAppFromNotificationCold(testSpec) {
    OpenAppFromNotificationCold(testSpec) {


    private val lockScreen = LockscreenController.get()

    override val openingNotificationsFromLockScreen = true
    override val openingNotificationsFromLockScreen = true


    override val transition: FlickerBuilder.() -> Unit
    override val transition: FlickerBuilder.() -> Unit
@@ -60,7 +57,7 @@ open class OpenAppFromLockNotificationCold(testSpec: FlickerTestParameter) :
            // Needs to run at start of transition,
            // Needs to run at start of transition,
            // so before the transition defined in super.transition
            // so before the transition defined in super.transition
            transitions {
            transitions {
                lockScreen.turnScreenOn()
                device.wakeUp()
            }
            }


            super.transition(this)
            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
            // Needs to run at the end of the setup, so after the setup defined in super.transition
            setup {
            setup {
                eachRun {
                eachRun {
                    lockScreen.lockScreen()
                    device.sleep()
                    wmHelper.StateSyncBuilder()
                    wmHelper.StateSyncBuilder()
                        .withKeyguardShowing()
                        .withoutTopVisibleAppWindows()
                        .waitForAndVerify()
                        .waitForAndVerify()
                }
                }
            }
            }
+5 −7
Original line number Original line Diff line number Diff line
@@ -16,9 +16,9 @@


package com.android.server.wm.flicker.launch
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.FlakyTest
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import android.platform.test.annotations.RequiresDevice
import android.platform.test.annotations.RequiresDevice
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameter
@@ -52,8 +52,6 @@ import org.junit.runners.Parameterized
open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
    OpenAppFromNotificationWarm(testSpec) {
    OpenAppFromNotificationWarm(testSpec) {


    private val lockScreen = LockscreenController.get()

    override val openingNotificationsFromLockScreen = true
    override val openingNotificationsFromLockScreen = true


    override val transition: FlickerBuilder.() -> Unit
    override val transition: FlickerBuilder.() -> Unit
@@ -61,7 +59,7 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
            // Needs to run at start of transition,
            // Needs to run at start of transition,
            // so before the transition defined in super.transition
            // so before the transition defined in super.transition
            transitions {
            transitions {
                lockScreen.turnScreenOn()
                device.wakeUp()
            }
            }


            super.transition(this)
            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
            // Needs to run at the end of the setup, so after the setup defined in super.transition
            setup {
            setup {
                eachRun {
                eachRun {
                    lockScreen.lockScreen()
                    device.sleep()
                    wmHelper.StateSyncBuilder()
                    wmHelper.StateSyncBuilder()
                        .withKeyguardShowing()
                        .withoutTopVisibleAppWindows()
                        .waitForAndVerify()
                        .waitForAndVerify()
                }
                }
            }
            }
@@ -195,7 +193,7 @@ open class OpenAppFromLockNotificationWarm(testSpec: FlickerTestParameter) :
        super.appWindowIsTopWindowAtEnd()
        super.appWindowIsTopWindowAtEnd()


    /** {@inheritDoc} */
    /** {@inheritDoc} */
    @Postsubmit
    @Presubmit
    @Test
    @Test
    override fun appWindowBecomesTopWindow_ShellTransit() =
    override fun appWindowBecomesTopWindow_ShellTransit() =
        super.appWindowBecomesTopWindow_ShellTransit()
        super.appWindowBecomesTopWindow_ShellTransit()
Loading