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

Commit 3a3cb5c0 authored by CHIA-HSUAN HSU's avatar CHIA-HSUAN HSU Committed by CHIA-HSUAN HSU (xWF)
Browse files

Reinstate EnterImmersiveViaHeaderMenuFlickerTest taskbar test

Test: USE_RBE=false atest WMShellFlickerTestsDesktopMode:com.android.wm.shell.flicker.immersive.EnterImmersiveViaHeaderMenuFlickerTest -c (http://ab/I07500010434309789)
Flag: EXEMPT reinstate taskbar test
Bug: 437760045
Change-Id: I61853f996a6eabbc8d02ac8086b4da6be6d04c78
parent 74c234d4
Loading
Loading
Loading
Loading
+4 −6
Original line number Original line Diff line number Diff line
@@ -33,7 +33,6 @@ import com.android.wm.shell.flicker.utils.appWindowKeepVisible
import com.android.wm.shell.flicker.utils.layerBecomesInvisible
import com.android.wm.shell.flicker.utils.layerBecomesInvisible
import com.android.wm.shell.flicker.utils.resizeVeilKeepsIncreasingInSize
import com.android.wm.shell.flicker.utils.resizeVeilKeepsIncreasingInSize
import com.android.wm.shell.scenarios.EnterImmersiveViaHeaderMenu
import com.android.wm.shell.scenarios.EnterImmersiveViaHeaderMenu
import org.junit.Ignore
import org.junit.Rule
import org.junit.Rule
import org.junit.Test
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runner.RunWith
@@ -67,7 +66,7 @@ class EnterImmersiveViaHeaderMenuFlickerTest(flicker: FlickerTest) : DesktopMode
    val testSetupRule =
    val testSetupRule =
        Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation)
        Utils.testSetupRule(NavBar.MODE_GESTURAL, flicker.scenario.startRotation)
    val scenario = EnterImmersiveViaHeaderMenuScenario()
    val scenario = EnterImmersiveViaHeaderMenuScenario()
    private val gameApp = scenario.gameApp
    private val immersiveApp = scenario.immersiveApp
    private val navBarMatcher: IComponentNameMatcher = ComponentNameMatcher.NAV_BAR
    private val navBarMatcher: IComponentNameMatcher = ComponentNameMatcher.NAV_BAR
    private val statusBarMatcher: IComponentNameMatcher = ComponentNameMatcher.STATUS_BAR
    private val statusBarMatcher: IComponentNameMatcher = ComponentNameMatcher.STATUS_BAR


@@ -79,19 +78,18 @@ class EnterImmersiveViaHeaderMenuFlickerTest(flicker: FlickerTest) : DesktopMode
        }
        }


    @Test
    @Test
    fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(gameApp)
    fun appWindowOnTopAtEnd() = flicker.appWindowOnTopAtEnd(immersiveApp)


    @Test
    @Test
    fun appWindowKeepVisible() = flicker.appWindowKeepVisible(gameApp)
    fun appWindowKeepVisible() = flicker.appWindowKeepVisible(immersiveApp)


    @Test
    @Test
    fun resizeVeilKeepsIncreasingInSize() = flicker.resizeVeilKeepsIncreasingInSize(gameApp)
    fun resizeVeilKeepsIncreasingInSize() = flicker.resizeVeilKeepsIncreasingInSize(immersiveApp)


    @Test
    @Test
    fun statusBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(statusBarMatcher)
    fun statusBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(statusBarMatcher)


    @Test
    @Test
    @Ignore("TODO: Reinstate this test once b/435359906 is fixed")
    fun taskBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(navBarMatcher)
    fun taskBarLayerBecomesInvisible() = flicker.layerBecomesInvisible(navBarMatcher)


    companion object {
    companion object {
+7 −7
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@ import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiDevice
import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
import com.android.server.wm.flicker.helpers.GameAppHelper
import com.android.server.wm.flicker.helpers.ImmersiveAppHelper
import org.junit.Before
import org.junit.Before
import org.junit.After
import org.junit.After
import org.junit.Ignore
import org.junit.Ignore
@@ -35,22 +35,22 @@ abstract class EnterImmersiveViaHeaderMenu(val rotation: Rotation = Rotation.ROT
    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    private val wmHelper = WindowManagerStateHelper(instrumentation)
    private val wmHelper = WindowManagerStateHelper(instrumentation)
    private val device = UiDevice.getInstance(instrumentation)
    private val device = UiDevice.getInstance(instrumentation)
    private val gameAppHelper = GameAppHelper(instrumentation)
    private val immersiveAppHelper = ImmersiveAppHelper(instrumentation)
    val gameApp = DesktopModeAppHelper(gameAppHelper)
    val immersiveApp = DesktopModeAppHelper(immersiveAppHelper)


    @Before
    @Before
    fun setup(){
    fun setup(){
        gameAppHelper.launchViaIntent(wmHelper)
        immersiveAppHelper.launchViaIntent(wmHelper)
        gameApp.enterDesktopModeFromAppHandleMenu(wmHelper, device, true)
        immersiveApp.enterDesktopModeFromAppHandleMenu(wmHelper, device, true)
    }
    }


    @Test
    @Test
    open fun enterImmersiveViaHeaderMenu() {
    open fun enterImmersiveViaHeaderMenu() {
        gameApp.enterImmersiveMode(wmHelper, device)
        immersiveApp.enterImmersiveMode(wmHelper, device)
    }
    }


    @After
    @After
    fun teardown() {
    fun teardown() {
        gameApp.exit(wmHelper)
        immersiveApp.exit(wmHelper)
    }
    }
}
}