From cc8ebd521d5ba295af64472ea0be6a12952b38a6 Mon Sep 17 00:00:00 2001 From: Ioana Moraru Date: Wed, 29 Sep 2021 13:49:03 +0000 Subject: [PATCH] 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 --- .../flicker/rotation/ChangeAppRotationTest.kt | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt index 4d4f2661e4d1c..fd8abc621b330 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/rotation/ChangeAppRotationTest.kt @@ -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) -> 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) } }