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

Commit 543c9767 authored by Charles Chen's avatar Charles Chen Committed by Android (Google) Code Review
Browse files

Merge "Introduce FlickerPropertyInitializer" into main

parents 48c6ef3f fec0618c
Loading
Loading
Loading
Loading
+1 −28
Original line number Diff line number Diff line
@@ -21,14 +21,8 @@ import android.platform.test.annotations.RequiresDevice
import android.platform.test.annotations.RequiresFlagsEnabled
import android.tools.flicker.subject.events.EventLogSubject
import android.tools.traces.component.ComponentNameMatcher
import android.tools.traces.parsers.WindowManagerStateHelper
import android.tools.traces.surfaceflinger.LayerTraceEntry
import android.tools.traces.wm.WindowManagerState
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.tapl.LauncherInstrumentation
import com.android.launcher3.tapl.LauncherInstrumentation.NavigationModel
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.wm.shell.Flags
import org.junit.ClassRule
import org.junit.FixMethodOrder
@@ -54,28 +48,7 @@ import org.junit.runners.MethodSorters
@Presubmit
class EnterBubbleViaBubbleMenuTest : BubbleFlickerTestBase() {

    companion object {
        private val instrumentation = InstrumentationRegistry.getInstrumentation()

        /**
         * Helper class to wait on [WindowManagerState] or [LayerTraceEntry] conditions.
         *
         * This is also used to wait for transition completes.
         */
        private val wmHelper = WindowManagerStateHelper(
            instrumentation,
            clearCacheAfterParsing = false,
        )

        /**
         * Used for building the scenario.
         */
        private val tapl: LauncherInstrumentation = LauncherInstrumentation()

        /**
         * The app used in scenario.
         */
        private val testApp = SimpleAppHelper(instrumentation)
    companion object : FlickerPropertyInitializer() {

        @ClassRule
        @JvmField
+54 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.wm.shell.flicker.bubbles

import android.app.Instrumentation
import android.tools.traces.parsers.WindowManagerStateHelper
import android.tools.traces.surfaceflinger.LayerTraceEntry
import android.tools.traces.wm.WindowManagerState
import androidx.test.platform.app.InstrumentationRegistry
import com.android.launcher3.tapl.LauncherInstrumentation
import com.android.server.wm.flicker.helpers.SimpleAppHelper

/**
 * A helper class used in `companion object` to initialize essential properties to launch flicker
 * tests.
 */
open class FlickerPropertyInitializer {

    val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()

    /**
     * Helper class to wait on [WindowManagerState] or [LayerTraceEntry] conditions.
     *
     * This is also used to wait for transition completes.
     */
    val wmHelper = WindowManagerStateHelper(
        instrumentation,
        clearCacheAfterParsing = false,
    )

    /**
     * Used for building the scenario.
     */
    val tapl: LauncherInstrumentation = LauncherInstrumentation()

    /**
     * The app used in scenario.
     */
    open val testApp = SimpleAppHelper(instrumentation)
}
 No newline at end of file