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

Commit 77d6c8a6 authored by Pablo Gamito's avatar Pablo Gamito
Browse files

Rename ComponentMatcher to ComponentNameMatcher

We now have a ComponentIdMatcher which means we renamed the ComponentMatcher to ComponentNameMatcher and had to slightly update the IComponentMatcher interface to be more generic. We also updated all places where we actually needed specifically a ComponentNameMatcher rather than just an IComponentMatcher.

Test: atest FlickerTests WmShellFlickerTests
Bug: 231974873
Change-Id: Ia30c82a9c55665659f530e7428a427763234aeb8
parent a89970c9
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@ import com.android.server.wm.flicker.statusBarLayerPositionAtStartAndEnd
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.taskBarLayerIsVisibleAtStartAndEnd
import com.android.server.wm.flicker.taskBarLayerIsVisibleAtStartAndEnd
import com.android.server.wm.flicker.taskBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.taskBarWindowIsAlwaysVisible
import com.android.server.wm.traces.common.ComponentMatcher
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import org.junit.Assume
import org.junit.Assume
import org.junit.Test
import org.junit.Test
+5 −5
Original line number Original line Diff line number Diff line
@@ -17,10 +17,10 @@
@file:JvmName("CommonConstants")
@file:JvmName("CommonConstants")
package com.android.wm.shell.flicker
package com.android.wm.shell.flicker


import com.android.server.wm.traces.common.ComponentMatcher
import com.android.server.wm.traces.common.ComponentNameMatcher


const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui"
const val SYSTEM_UI_PACKAGE_NAME = "com.android.systemui"
val APP_PAIR_SPLIT_DIVIDER_COMPONENT = ComponentMatcher("", "AppPairSplitDivider#")
val APP_PAIR_SPLIT_DIVIDER_COMPONENT = ComponentNameMatcher("", "AppPairSplitDivider#")
val DOCKED_STACK_DIVIDER_COMPONENT = ComponentMatcher("", "DockedStackDivider#")
val DOCKED_STACK_DIVIDER_COMPONENT = ComponentNameMatcher("", "DockedStackDivider#")
val SPLIT_SCREEN_DIVIDER_COMPONENT = ComponentMatcher("", "StageCoordinatorSplitDivider#")
val SPLIT_SCREEN_DIVIDER_COMPONENT = ComponentNameMatcher("", "StageCoordinatorSplitDivider#")
val SPLIT_DECOR_MANAGER = ComponentMatcher("", "SplitDecorManager#")
val SPLIT_DECOR_MANAGER = ComponentNameMatcher("", "SplitDecorManager#")
+2 −2
Original line number Original line Diff line number Diff line
@@ -17,10 +17,10 @@
package com.android.wm.shell.flicker.helpers
package com.android.wm.shell.flicker.helpers


import android.app.Instrumentation
import android.app.Instrumentation
import com.android.server.wm.traces.common.IComponentMatcher
import com.android.server.wm.traces.common.ComponentNameMatcher


class AppPairsHelper(
class AppPairsHelper(
    instrumentation: Instrumentation,
    instrumentation: Instrumentation,
    activityLabel: String,
    activityLabel: String,
    component: IComponentMatcher
    component: ComponentNameMatcher
) : BaseAppHelper(instrumentation, activityLabel, component)
) : BaseAppHelper(instrumentation, activityLabel, component)
+2 −5
Original line number Original line Diff line number Diff line
@@ -26,13 +26,13 @@ import androidx.test.uiautomator.UiObject2
import androidx.test.uiautomator.Until
import androidx.test.uiautomator.Until
import com.android.compatibility.common.util.SystemUtil
import com.android.compatibility.common.util.SystemUtil
import com.android.server.wm.flicker.helpers.StandardAppHelper
import com.android.server.wm.flicker.helpers.StandardAppHelper
import com.android.server.wm.traces.common.IComponentMatcher
import com.android.server.wm.traces.common.IComponentNameMatcher
import java.io.IOException
import java.io.IOException


abstract class BaseAppHelper(
abstract class BaseAppHelper(
    instrumentation: Instrumentation,
    instrumentation: Instrumentation,
    launcherName: String,
    launcherName: String,
    component: IComponentMatcher
    component: IComponentNameMatcher
) : StandardAppHelper(
) : StandardAppHelper(
    instrumentation,
    instrumentation,
    launcherName,
    launcherName,
@@ -46,9 +46,6 @@ abstract class BaseAppHelper(
            hasSystemFeature(FEATURE_LEANBACK) || hasSystemFeature(FEATURE_LEANBACK_ONLY)
            hasSystemFeature(FEATURE_LEANBACK) || hasSystemFeature(FEATURE_LEANBACK_ONLY)
        }
        }


    val defaultWindowName: String
        get() = toWindowName()

    val ui: UiObject2?
    val ui: UiObject2?
        get() = uiDevice.findObject(appSelector)
        get() = uiDevice.findObject(appSelector)


+2 −2
Original line number Original line Diff line number Diff line
@@ -19,12 +19,12 @@ package com.android.wm.shell.flicker.helpers
import android.app.Instrumentation
import android.app.Instrumentation
import android.content.Context
import android.content.Context
import android.provider.Settings
import android.provider.Settings
import com.android.server.wm.traces.common.IComponentMatcher
import com.android.server.wm.traces.common.ComponentNameMatcher


class MultiWindowHelper(
class MultiWindowHelper(
    instrumentation: Instrumentation,
    instrumentation: Instrumentation,
    activityLabel: String,
    activityLabel: String,
    componentsInfo: IComponentMatcher
    componentsInfo: ComponentNameMatcher
) : BaseAppHelper(instrumentation, activityLabel, componentsInfo) {
) : BaseAppHelper(instrumentation, activityLabel, componentsInfo) {


    companion object {
    companion object {
Loading