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

Commit 8408bf64 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix the case that the app doesn't exist"

parents bcc31bca 2bf00ccc
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -45,14 +45,23 @@ fun FlickerTestParameter.appPairsDividerBecomesVisible() {
fun FlickerTestParameter.splitScreenEntered(
    component1: IComponentMatcher,
    component2: IComponentMatcher,
    fromOtherApp: Boolean
    fromOtherApp: Boolean,
    appExistAtStart: Boolean = true
) {
    if (fromOtherApp) {
        if (appExistAtStart) {
            appWindowIsInvisibleAtStart(component1)
        } else {
            appWindowIsNotContainAtStart(component1)
        }
    } else {
        appWindowIsVisibleAtStart(component1)
    }
    if (appExistAtStart) {
        appWindowIsInvisibleAtStart(component2)
    } else {
        appWindowIsNotContainAtStart(component2)
    }
    splitScreenDividerIsInvisibleAtStart()

    appWindowIsVisibleAtEnd(component1)
@@ -315,6 +324,10 @@ fun FlickerTestParameter.appWindowIsInvisibleAtEnd(component: IComponentMatcher)
    assertWmEnd { this.isAppWindowInvisible(component) }
}

fun FlickerTestParameter.appWindowIsNotContainAtStart(component: IComponentMatcher) {
    assertWmStart { this.notContains(component) }
}

fun FlickerTestParameter.appWindowKeepVisible(component: IComponentMatcher) {
    assertWm { this.isAppWindowVisible(component) }
}
+11 −3
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import com.android.server.wm.flicker.FlickerParametersRunnerFactory
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.wm.shell.flicker.appWindowBecomesVisible
import com.android.wm.shell.flicker.appWindowIsVisibleAtEnd
import com.android.wm.shell.flicker.layerBecomesVisible
import com.android.wm.shell.flicker.layerIsVisibleAtEnd
@@ -78,7 +77,8 @@ class EnterSplitScreenByDragFromShortcut(

    @Postsubmit
    @Test
    fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp, fromOtherApp = false)
    fun cujCompleted() = testSpec.splitScreenEntered(primaryApp, secondaryApp,
        fromOtherApp = false, appExistAtStart = false)

    @Postsubmit
    @Test
@@ -108,7 +108,15 @@ class EnterSplitScreenByDragFromShortcut(

    @Postsubmit
    @Test
    fun secondaryAppWindowBecomesVisible() = testSpec.appWindowBecomesVisible(secondaryApp)
    fun secondaryAppWindowBecomesVisible() {
        testSpec.assertWm {
            this.notContains(secondaryApp)
                .then()
                .isAppWindowInvisible(secondaryApp, isOptional = true)
                .then()
                .isAppWindowVisible(secondaryApp)
        }
    }

    /** {@inheritDoc} */
    @Postsubmit