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

Commit dd71fe69 authored by Vania Desmonda's avatar Vania Desmonda
Browse files

Fix UnminimizeAppFromTaskbarTest by using gmail instead of browser app.

The browser app consistently fails on setup because it can't find the
minimize button, so use Gmail instead which is by default always on the
taskbar.

Test: atest WMShellFlickerTestsDesktopMode:com.android.wm.shell.functional.UnminimizeAppFromTaskbarTest
Fixes: 400419745
Flag: EXEMPT flicker test fix

Change-Id: I4882b4d1796507406d6babab667b80f0287fd59b
parent 33dd7c0a
Loading
Loading
Loading
Loading
+8 −8
Original line number Original line Diff line number Diff line
@@ -19,7 +19,7 @@ package com.android.wm.shell.scenarios
import android.app.Instrumentation
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.NavBar
import android.tools.Rotation
import android.tools.Rotation
import android.tools.device.apphelpers.BrowserAppHelper
import android.tools.device.apphelpers.GmailAppHelper
import android.tools.flicker.rules.ChangeDisplayOrientationRule
import android.tools.flicker.rules.ChangeDisplayOrientationRule
import android.tools.traces.parsers.WindowManagerStateHelper
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.platform.app.InstrumentationRegistry
@@ -44,8 +44,8 @@ abstract class UnminimizeAppFromTaskbar(val rotation: Rotation = Rotation.ROTATI
    private val wmHelper = WindowManagerStateHelper(instrumentation)
    private val wmHelper = WindowManagerStateHelper(instrumentation)
    private val device = UiDevice.getInstance(instrumentation)
    private val device = UiDevice.getInstance(instrumentation)
    private val testApp = DesktopModeAppHelper(SimpleAppHelper(instrumentation))
    private val testApp = DesktopModeAppHelper(SimpleAppHelper(instrumentation))
    private val browserHelper = BrowserAppHelper(instrumentation)
    private val gmailHelper = GmailAppHelper(instrumentation)
    private val browserApp = DesktopModeAppHelper(browserHelper)
    private val gmailApp = DesktopModeAppHelper(gmailHelper)


    @Rule
    @Rule
    @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation)
    @JvmField val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation)
@@ -59,20 +59,20 @@ abstract class UnminimizeAppFromTaskbar(val rotation: Rotation = Rotation.ROTATI
        ChangeDisplayOrientationRule.setRotation(rotation)
        ChangeDisplayOrientationRule.setRotation(rotation)
        testApp.enterDesktopMode(wmHelper, device)
        testApp.enterDesktopMode(wmHelper, device)
        tapl.showTaskbarIfHidden()
        tapl.showTaskbarIfHidden()
        browserApp.launchViaIntent(wmHelper)
        gmailApp.launchViaIntent(wmHelper)
        browserApp.minimizeDesktopApp(wmHelper, device)
        gmailApp.minimizeDesktopApp(wmHelper, device)
    }
    }


    @Test
    @Test
    open fun unminimizeApp() {
    open fun unminimizeApp() {
        tapl.launchedAppState.taskbar
        tapl.launchedAppState.taskbar
            .getAppIcon(browserHelper.appName)
            .getAppIcon(gmailHelper.appName)
            .launch(browserHelper.packageName)
            .launch(gmailHelper.packageName)
    }
    }


    @After
    @After
    fun teardown() {
    fun teardown() {
        testApp.exit(wmHelper)
        testApp.exit(wmHelper)
        browserApp.exit(wmHelper)
        gmailApp.exit(wmHelper)
    }
    }
}
}
 No newline at end of file