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

Commit 0a31f4c4 authored by Ioana Moraru's avatar Ioana Moraru Committed by Android (Google) Code Review
Browse files

Merge "Enable FASS assertions for app close"

parents 90e7fe0c 39f631c3
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -17,7 +17,9 @@
package com.android.server.wm.flicker.close

import android.app.Instrumentation
import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.platform.app.InstrumentationRegistry
import com.android.server.wm.flicker.FlickerBuilderProvider
import com.android.server.wm.flicker.FlickerTestParameter
@@ -35,6 +37,8 @@ import com.android.server.wm.flicker.statusBarLayerIsVisible
import com.android.server.wm.flicker.statusBarLayerRotatesScales
import com.android.server.wm.flicker.statusBarWindowIsVisible
import com.android.server.wm.flicker.replacesLayer
import com.android.server.wm.flicker.rules.WMFlickerServiceRuleForTestSpec
import org.junit.Rule
import org.junit.Test

/**
@@ -44,6 +48,9 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
    protected val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
    protected open val testApp: StandardAppHelper = SimpleAppHelper(instrumentation)

    @get:Rule
    val flickerRule = WMFlickerServiceRuleForTestSpec(testSpec)

    /**
     * Specification of the test transition to execute
     */
@@ -189,4 +196,22 @@ abstract class CloseAppTransition(protected val testSpec: FlickerTestParameter)
    open fun launcherLayerReplacesApp() {
        testSpec.replacesLayer(testApp.component, LAUNCHER_COMPONENT)
    }

    @Postsubmit
    @Test
    fun runPresubmitAssertion() {
        flickerRule.checkPresubmitAssertions()
    }

    @Postsubmit
    @Test
    fun runPostsubmitAssertion() {
        flickerRule.checkPostsubmitAssertions()
    }

    @FlakyTest
    @Test
    fun runFlakyAssertion() {
        flickerRule.checkFlakyAssertions()
    }
}
 No newline at end of file