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

Commit 6ce048da authored by Luca Zuccarini's avatar Luca Zuccarini
Browse files

Exempt Auto targets from AnimatorTestRuleToolkitTest.

Fix: 384952522
Fix: 394673295
Flag: EXEMPT test only
Test: atest AnimatorTestRuleToolkitTest
Change-Id: I7bc00712dd43b41d45b3ff60a9e16de5a4ffe3ed
parent adda536b
Loading
Loading
Loading
Loading
+15 −6
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.animation
package android.animation


import android.content.pm.PackageManager
import android.graphics.Color
import android.graphics.Color
import android.platform.test.annotations.MotionTest
import android.platform.test.annotations.MotionTest
import android.view.ViewGroup
import android.view.ViewGroup
@@ -23,11 +24,14 @@ import android.widget.FrameLayout
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import androidx.test.filters.SmallTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import com.android.internal.dynamicanimation.animation.DynamicAnimation
import com.android.internal.dynamicanimation.animation.DynamicAnimation
import com.android.internal.dynamicanimation.animation.SpringAnimation
import com.android.internal.dynamicanimation.animation.SpringAnimation
import com.android.internal.dynamicanimation.animation.SpringForce
import com.android.internal.dynamicanimation.animation.SpringForce
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.TestScope
import org.junit.Assume.assumeFalse
import org.junit.Before
import org.junit.Rule
import org.junit.Rule
import org.junit.Test
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runner.RunWith
@@ -65,6 +69,16 @@ class AnimatorTestRuleToolkitTest {
            bitmapDiffer = screenshotRule,
            bitmapDiffer = screenshotRule,
        )
        )


    @Before
    fun setUp() {
        // Do not run on Automotive.
        assumeFalse(
            InstrumentationRegistry.getInstrumentation().context.packageManager.hasSystemFeature(
                PackageManager.FEATURE_AUTOMOTIVE
            )
        )
    }

    @Test
    @Test
    fun recordFilmstrip_withAnimator() {
    fun recordFilmstrip_withAnimator() {
        val animatedBox = createScene()
        val animatedBox = createScene()
@@ -188,12 +202,7 @@ class AnimatorTestRuleToolkitTest {
                null
                null
            }
            }
        return motionRule.recordMotion(
        return motionRule.recordMotion(
            AnimatorRuleRecordingSpec(
            AnimatorRuleRecordingSpec(container, motionControl, sampleIntervalMs, visualCapture) {
                container,
                motionControl,
                sampleIntervalMs,
                visualCapture,
            ) {
                feature(ViewFeatureCaptures.alpha, "alpha")
                feature(ViewFeatureCaptures.alpha, "alpha")
            }
            }
        )
        )