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

Commit 879effc8 authored by dakinola's avatar dakinola
Browse files

Fix Maximize Portrait Scenario + Snap Resize not finding traces

Forgot to actually set the display rotation for each maximize flicker scenario, so every scenario was in the same orientation. Snap Resize scenarios sometimes can't find the trace, might be because of there not being a clear point where the scenario stops due to not having the test setup rule to start a new activity.

Bug: 363231478
Fix: 363232880
Test: atest MaximizeAppPortrait
Flag: TEST_ONLY
Change-Id: I8a203e99ede4c764fa032dc546f370e04c61c8c7
parent a3c982cc
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -16,10 +16,11 @@

package com.android.wm.shell.scenarios

import android.platform.test.annotations.Postsubmit
import android.app.Instrumentation
import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import android.tools.flicker.rules.ChangeDisplayOrientationRule
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -36,11 +37,12 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner

@RunWith(BlockJUnit4ClassRunner::class)
@Postsubmit
open class MaximizeAppWindow
@JvmOverloads
constructor(rotation: Rotation = Rotation.ROTATION_0, isResizable: Boolean = true) {
constructor(private val rotation: Rotation = Rotation.ROTATION_0, isResizable: Boolean = true) {

    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val tapl = LauncherInstrumentation()
@@ -57,6 +59,9 @@ constructor(rotation: Rotation = Rotation.ROTATION_0, isResizable: Boolean = tru
    @Before
    fun setup() {
        Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet)
        tapl.setEnableRotation(true)
        tapl.setExpectedRotation(rotation.value)
        ChangeDisplayOrientationRule.setRotation(rotation)
        testApp.enterDesktopWithDrag(wmHelper, device)
    }

+9 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.wm.shell.scenarios

import android.app.Instrumentation
import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -26,9 +28,11 @@ import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.window.flags.Flags
import com.android.wm.shell.Utils
import org.junit.After
import org.junit.Assume
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner
@@ -37,7 +41,7 @@ import org.junit.runners.BlockJUnit4ClassRunner
@Postsubmit
open class SnapResizeAppWindowWithButton
@JvmOverloads
constructor(private val toLeft: Boolean = true, private val isResizable: Boolean = true) {
constructor(private val toLeft: Boolean = true, isResizable: Boolean = true) {

    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val tapl = LauncherInstrumentation()
@@ -49,6 +53,10 @@ constructor(private val toLeft: Boolean = true, private val isResizable: Boolean
        DesktopModeAppHelper(NonResizeableAppHelper(instrumentation))
    }

    @Rule
    @JvmField
    val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, Rotation.ROTATION_0)

    @Before
    fun setup() {
        Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet)
+9 −1
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ package com.android.wm.shell.scenarios

import android.app.Instrumentation
import android.platform.test.annotations.Postsubmit
import android.tools.NavBar
import android.tools.Rotation
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
@@ -26,9 +28,11 @@ import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.window.flags.Flags
import com.android.wm.shell.Utils
import org.junit.After
import org.junit.Assume
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.BlockJUnit4ClassRunner
@@ -37,7 +41,7 @@ import org.junit.runners.BlockJUnit4ClassRunner
@Postsubmit
open class SnapResizeAppWindowWithDrag
@JvmOverloads
constructor(private val toLeft: Boolean = true, private val isResizable: Boolean = true) {
constructor(private val toLeft: Boolean = true, isResizable: Boolean = true) {

    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val tapl = LauncherInstrumentation()
@@ -49,6 +53,10 @@ constructor(private val toLeft: Boolean = true, private val isResizable: Boolean
        DesktopModeAppHelper(NonResizeableAppHelper(instrumentation))
    }

    @Rule
    @JvmField
    val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, Rotation.ROTATION_0)

    @Before
    fun setup() {
        Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet)