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

Commit cbf93258 authored by dakinola's avatar dakinola
Browse files

Jank CUJ: Maximizing Non-Resizable App

Bug: 339583424
Flag: TEST_ONLY
Test: atest systemui-desktopmode-jank-suite -- --enable-module-dynamic-download --test-arg com.android.tradefed.testtype.AndroidJUnitTest:class:android.platform.test.scenario.sysui.desktopmode.MaximizeNonResizableAppWindowMicrobenchmark
Change-Id: Iea8ae7f05d93e1b03c1d08e18f4d8f30ccb62110
parent 02b43227
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import com.android.launcher3.tapl.LauncherInstrumentation
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
@@ -38,15 +39,20 @@ import org.junit.runners.BlockJUnit4ClassRunner
@RunWith(BlockJUnit4ClassRunner::class)
@Postsubmit
open class MaximizeAppWindow
{
@JvmOverloads
constructor(rotation: Rotation = Rotation.ROTATION_0, isResizable: Boolean = true) {

    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val tapl = LauncherInstrumentation()
    private val wmHelper = WindowManagerStateHelper(instrumentation)
    private val device = UiDevice.getInstance(instrumentation)
    private val testApp = DesktopModeAppHelper(SimpleAppHelper(instrumentation))
    private val testApp = if (isResizable) {
        DesktopModeAppHelper(SimpleAppHelper(instrumentation))
    } else {
        DesktopModeAppHelper(NonResizeableAppHelper(instrumentation))
    }

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

    @Before
    fun setup() {