From 3960bf6534a4c8277b068802aa0e267eb2f7d349 Mon Sep 17 00:00:00 2001 From: Ioana Moraru Date: Wed, 13 Oct 2021 20:38:36 +0000 Subject: [PATCH] Enable FASS assertions for IME Appear Add a new test rule to OpenImeWindowTest 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: I018c657f12cfbf2377b4353c13981f2c000f6ccf --- .../wm/flicker/ime/OpenImeWindowTest.kt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt index 7bf0186cd857e..1feb785d9f539 100644 --- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt +++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt @@ -17,6 +17,7 @@ package com.android.server.wm.flicker.ime import android.app.Instrumentation +import android.platform.test.annotations.Postsubmit import android.platform.test.annotations.Presubmit import android.view.Surface import android.view.WindowManagerPolicyConstants @@ -34,10 +35,12 @@ import com.android.server.wm.flicker.navBarLayerRotatesAndScales import com.android.server.wm.flicker.navBarWindowIsVisible import com.android.server.wm.flicker.entireScreenCovered import com.android.server.wm.flicker.dsl.FlickerBuilder +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 org.junit.FixMethodOrder +import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.MethodSorters @@ -53,6 +56,9 @@ import org.junit.runners.Parameterized @FixMethodOrder(MethodSorters.NAME_ASCENDING) @Group2 class OpenImeWindowTest(private val testSpec: FlickerTestParameter) { + @get:Rule + val flickerRule = WMFlickerServiceRuleForTestSpec(testSpec) + private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation() private val testApp = ImeAppHelper(instrumentation) @@ -146,6 +152,24 @@ class OpenImeWindowTest(private val testSpec: FlickerTestParameter) { } } + @Postsubmit + @Test + fun runPresubmitAssertion() { + flickerRule.checkPresubmitAssertions() + } + + @Postsubmit + @Test + fun runPostsubmitAssertion() { + flickerRule.checkPostsubmitAssertions() + } + + @FlakyTest + @Test + fun runFlakyAssertion() { + flickerRule.checkFlakyAssertions() + } + companion object { @Parameterized.Parameters(name = "{0}") @JvmStatic