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

Commit 45a5ba0b authored by Vania Desmonda's avatar Vania Desmonda Committed by Android (Google) Code Review
Browse files

Merge "Remove all desks before starting test." into main

parents 7ccd0e18 0f7f4af4
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -16,11 +16,25 @@

package com.android.wm.shell.scenarios

import android.app.Instrumentation
import android.platform.test.rule.ScreenRecordRule
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule

@Ignore("Base Test Class")
abstract class TestScenarioBase {
    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val device = UiDevice.getInstance(instrumentation)

    @get:Rule val screenRecordRule = ScreenRecordRule(/* keepTestLevelRecordingOnSuccess= */ false)

    @Before
    fun removeAllDesks() {
        device.executeShellCommand(
            "dumpsys activity service SystemUIService WMShell desktopmode removeAllDesks"
        )
    }
}