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

Commit 1ffa69e1 authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Fix tapl unexpected rotation errors

Bug: 300065764
Test: atest WMShellFlickerServiceTests
Change-Id: I179614bf64ff3171879303e24827ba340368c6a9
parent 69147f18
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.service.splitscreen.scenarios
import android.app.Instrumentation
import android.tools.common.NavBar
import android.tools.common.Rotation
import android.tools.device.flicker.rules.ChangeDisplayOrientationRule
import android.tools.device.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -49,11 +50,13 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
    fun setup() {
        Assume.assumeTrue(tapl.isTablet)

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)

        tapl.goHome()

        primaryApp.launchViaIntent(wmHelper)
        ChangeDisplayOrientationRule.setRotation(rotation)

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)
    }

    @Test
+6 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.service.splitscreen.scenarios
import android.app.Instrumentation
import android.tools.common.NavBar
import android.tools.common.Rotation
import android.tools.device.flicker.rules.ChangeDisplayOrientationRule
import android.tools.device.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -50,14 +51,16 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
    fun setup() {
        Assume.assumeTrue(tapl.isTablet)

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)

        // Send a notification
        sendNotificationApp.launchViaIntent(wmHelper)
        sendNotificationApp.postNotification(wmHelper)
        tapl.goHome()

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)

        primaryApp.launchViaIntent(wmHelper)
        ChangeDisplayOrientationRule.setRotation(rotation)
    }

    @Test
+5 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.wm.shell.flicker.service.splitscreen.scenarios
import android.app.Instrumentation
import android.tools.common.NavBar
import android.tools.common.Rotation
import android.tools.device.flicker.rules.ChangeDisplayOrientationRule
import android.tools.device.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -49,12 +50,13 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
    fun setup() {
        Assume.assumeTrue(tapl.isTablet)

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)

        tapl.goHome()
        SplitScreenUtils.createShortcutOnHotseatIfNotExist(tapl, secondaryApp.appName)
        primaryApp.launchViaIntent(wmHelper)
        ChangeDisplayOrientationRule.setRotation(rotation)

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)
    }

    @Test
+3 −3
Original line number Diff line number Diff line
@@ -46,9 +46,6 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {

    @Before
    fun setup() {
        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)

        primaryApp.launchViaIntent(wmHelper)
        secondaryApp.launchViaIntent(wmHelper)
        tapl.goHome()
@@ -57,6 +54,9 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {
            .withAppTransitionIdle()
            .withHomeActivityVisible()
            .waitForAndVerify()

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)
    }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -48,11 +48,11 @@ constructor(val rotation: Rotation = Rotation.ROTATION_0) {

    @Before
    fun setup() {
        tapl.workspace.switchToOverview().dismissAllTasks()

        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)

        tapl.workspace.switchToOverview().dismissAllTasks()

        SplitScreenUtils.enterSplit(wmHelper, tapl, device, primaryApp, secondaryApp, rotation)
    }

Loading