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

Commit f226bc08 authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Remove quicksearchbox from home window list

Previously Winscope considered only the `isVisible` property to determine if the window was visible or not. This failed in cases such as `com.google.android.googlequicksearchbox/android.app.ContextImpl` when launching apps, where `isVisible=true` and `alpha=0`

Bug: 181630910
Bug: 182720234
Test: atest FlickerTests WMShellFlickerTests
Change-Id: I75fab0c6de02e43265002986901353f8e230baa5
parent aaeacb80
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import androidx.test.filters.RequiresDevice
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.LAUNCHER_TITLE
import com.android.server.wm.flicker.HOME_WINDOW_TITLE
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.launchSplitScreen
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
@@ -62,7 +62,7 @@ class EnterSplitScreenDockActivity(
    override val ignoredWindows: List<String>
        get() = listOf(LAUNCHER_PACKAGE_NAME, LIVE_WALLPAPER_PACKAGE_NAME,
            splitScreenApp.defaultWindowName, WindowManagerStateHelper.SPLASH_SCREEN_NAME,
            WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME, *LAUNCHER_TITLE)
            WindowManagerStateHelper.SNAPSHOT_WINDOW_NAME, *HOME_WINDOW_TITLE)

    @FlakyTest(bugId = 169271943)
    @Test
+8 −8
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelpe
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.STATUS_BAR_LAYER_NAME
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper.Companion.STATUS_BAR_WINDOW_NAME

val LAUNCHER_TITLE = arrayOf("Wallpaper", "Launcher", "com.google.android.googlequicksearchbox")
val HOME_WINDOW_TITLE = arrayOf("Wallpaper", "Launcher")

fun FlickerTestParameter.statusBarWindowIsAlwaysVisible() {
    assertWm {
@@ -41,23 +41,23 @@ fun FlickerTestParameter.launcherReplacesAppWindowAsTopWindow(testApp: IAppHelpe
    assertWm {
        this.showsAppWindowOnTop(testApp.getPackage())
            .then()
            .showsAppWindowOnTop(*LAUNCHER_TITLE)
            .showsAppWindowOnTop(*HOME_WINDOW_TITLE)
    }
}

fun FlickerTestParameter.launcherWindowBecomesVisible() {
    assertWm {
        this.hidesBelowAppWindow(*LAUNCHER_TITLE)
        this.hidesBelowAppWindow(*HOME_WINDOW_TITLE)
            .then()
            .showsBelowAppWindow(*LAUNCHER_TITLE)
            .showsBelowAppWindow(*HOME_WINDOW_TITLE)
    }
}

fun FlickerTestParameter.launcherWindowBecomesInvisible() {
    assertWm {
        this.showsBelowAppWindow(*LAUNCHER_TITLE)
        this.showsBelowAppWindow(*HOME_WINDOW_TITLE)
            .then()
            .hidesBelowAppWindow(*LAUNCHER_TITLE)
            .hidesBelowAppWindow(*HOME_WINDOW_TITLE)
    }
}

@@ -179,7 +179,7 @@ fun FlickerTestParameter.statusBarLayerRotatesScales(

fun FlickerTestParameter.appLayerReplacesLauncher(appName: String) {
    assertLayers {
        this.isVisible(*LAUNCHER_TITLE)
        this.isVisible(*HOME_WINDOW_TITLE)
            .then()
            .isVisible(appName)
    }
@@ -190,7 +190,7 @@ fun FlickerTestParameter.launcherLayerReplacesApp(testApp: IAppHelper) {
        this.isVisible(testApp.getPackage())
            .then()
            .isInvisible(testApp.getPackage())
            .isVisible(*LAUNCHER_TITLE)
            .isVisible(*HOME_WINDOW_TITLE)
    }
}

+2 −2
Original line number Diff line number Diff line
@@ -18,11 +18,11 @@ package com.android.server.wm.flicker.launch

import android.platform.helpers.IAppHelper
import com.android.server.wm.flicker.FlickerTestParameter
import com.android.server.wm.flicker.LAUNCHER_TITLE
import com.android.server.wm.flicker.HOME_WINDOW_TITLE

fun FlickerTestParameter.appWindowReplacesLauncherAsTopWindow(testApp: IAppHelper) {
    assertWm {
        this.showsAppWindowOnTop(*LAUNCHER_TITLE)
        this.showsAppWindowOnTop(*HOME_WINDOW_TITLE)
            .then()
            .showsAppWindowOnTop("Snapshot", testApp.getPackage())
    }