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

Commit aff80feb authored by Orhan Uysal's avatar Orhan Uysal
Browse files

Modify to accommodate changes in StandardAppHelper

Modify `PipAppHelper` and `ImeShownOnAppStartHelper` classes to work with the new changes in `waitConditions` parameter in `StandardAppHelper#launchViaIntent`.

Bug: 299059643
Test: atest FlickerTestsIme | atest WMShellFlickerTestsPip

Change-Id: I2699dcfa75c1e150f819a00ea9a7630dc43e7c19
parent 4f69320b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -18,8 +18,6 @@ package com.android.server.wm.flicker.helpers

import android.app.Instrumentation
import android.tools.common.Rotation
import android.tools.common.traces.Condition
import android.tools.common.traces.DeviceStateDump
import android.tools.common.traces.component.ComponentNameMatcher
import android.tools.common.traces.component.IComponentMatcher
import android.tools.device.helpers.FIND_TIMEOUT
@@ -54,14 +52,14 @@ constructor(
        launchedAppComponentMatcherOverride: IComponentMatcher?,
        action: String?,
        stringExtras: Map<String, String>,
        waitConditions: Array<Condition<DeviceStateDump>>
        waitConditionsBuilder: WindowManagerStateHelper.StateSyncBuilder
    ) {
        super.launchViaIntent(
            wmHelper,
            launchedAppComponentMatcherOverride,
            action,
            stringExtras,
            waitConditions
            waitConditionsBuilder
        )
        waitIMEShown(wmHelper)
    }
+7 −3
Original line number Diff line number Diff line
@@ -244,12 +244,16 @@ open class PipAppHelper(instrumentation: Instrumentation) :
        action: String? = null,
        stringExtras: Map<String, String>
    ) {
        launchViaIntentAndWaitShown(
        launchViaIntent(
            wmHelper,
            launchedAppComponentMatcherOverride,
            action,
            stringExtras,
            waitConditions = arrayOf(ConditionsFactory.hasPipWindow())
            waitConditionsBuilder = wmHelper
                .StateSyncBuilder()
                .add(ConditionsFactory.isWMStateComplete())
                .withAppTransitionIdle()
                .add(ConditionsFactory.hasPipWindow())
        )

        wmHelper
@@ -261,7 +265,7 @@ open class PipAppHelper(instrumentation: Instrumentation) :

    /** Expand the PIP window back to full screen via intent and wait until the app is visible */
    fun exitPipToFullScreenViaIntent(wmHelper: WindowManagerStateHelper) =
        launchViaIntentAndWaitShown(wmHelper)
        launchViaIntent(wmHelper)

    fun clickEnterPipButton(wmHelper: WindowManagerStateHelper) {
        clickObject(ENTER_PIP_BUTTON_ID)