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

Commit cc8ebd52 authored by Ioana Moraru's avatar Ioana Moraru
Browse files

Enable FASS assertions for regular rotation

Add a new test rule to ChangeAppRotationTest for comparing the new FASS
assertions with the old flicker testing. If the flicker tests from one category
(presubmit/postsumbit/flaky) are passing or failing, the corresponding
FASS test should have the same behaviour.

Bug: 201523242
Test: see the results in the dashboard go/wm-tests-flicker
Change-Id: I9a99248790e6496a87e24c6bcc2f0be7126d6dcf
parent 492a0294
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.wm.flicker.rotation

import android.platform.test.annotations.Postsubmit
import android.platform.test.annotations.Presubmit
import androidx.test.filters.FlakyTest
import androidx.test.filters.RequiresDevice
@@ -25,11 +26,13 @@ import com.android.server.wm.flicker.FlickerTestParameterFactory
import com.android.server.wm.flicker.annotation.Group3
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.server.wm.flicker.rules.WMFlickerServiceRuleForTestSpec
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.traces.common.FlickerComponentName
import org.junit.FixMethodOrder
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -78,6 +81,9 @@ import org.junit.runners.Parameterized
class ChangeAppRotationTest(
    testSpec: FlickerTestParameter
) : RotationTransition(testSpec) {
    @get:Rule
    val flickerRule = WMFlickerServiceRuleForTestSpec(testSpec)

    override val testApp = SimpleAppHelper(instrumentation)
    override val transition: FlickerBuilder.(Map<String, Any?>) -> Unit
        get() = {
@@ -89,6 +95,24 @@ class ChangeAppRotationTest(
            }
        }

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

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

    @FlakyTest
    @Test
    fun runFlakyAssertion() {
        flickerRule.checkFlakyAssertions()
    }

    /** {@inheritDoc} */
    @FlakyTest(bugId = 190185577)
    @Test
@@ -109,6 +133,7 @@ class ChangeAppRotationTest(
                .isVisible(FlickerComponentName.ROTATION)
                .then()
                .isVisible(testApp.component)
                .isInvisible(FlickerComponentName.ROTATION)
        }
    }