diff options
| author | 2025-02-11 13:02:32 +0000 | |
|---|---|---|
| committer | 2025-02-11 05:09:56 -0800 | |
| commit | 6ce048daa9a72f144edab00a0c2a8a5bfa29c960 (patch) | |
| tree | 89dc36ea4516a206d5f9620d735ed153afe0a56c | |
| parent | adda536bdf25607418378ebb1f7253d41da1b58a (diff) | |
Exempt Auto targets from AnimatorTestRuleToolkitTest.
Fix: 384952522
Fix: 394673295
Flag: EXEMPT test only
Test: atest AnimatorTestRuleToolkitTest
Change-Id: I7bc00712dd43b41d45b3ff60a9e16de5a4ffe3ed
| -rw-r--r-- | tests/testables/tests/src/android/animation/AnimatorTestRuleToolkitTest.kt | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/testables/tests/src/android/animation/AnimatorTestRuleToolkitTest.kt b/tests/testables/tests/src/android/animation/AnimatorTestRuleToolkitTest.kt index 993c3fed9d59..2eb8ba1be811 100644 --- a/tests/testables/tests/src/android/animation/AnimatorTestRuleToolkitTest.kt +++ b/tests/testables/tests/src/android/animation/AnimatorTestRuleToolkitTest.kt @@ -16,6 +16,7 @@ package android.animation +import android.content.pm.PackageManager import android.graphics.Color import android.platform.test.annotations.MotionTest import android.view.ViewGroup @@ -23,11 +24,14 @@ import android.widget.FrameLayout import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.filters.SmallTest +import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation import com.android.internal.dynamicanimation.animation.DynamicAnimation import com.android.internal.dynamicanimation.animation.SpringAnimation import com.android.internal.dynamicanimation.animation.SpringForce import kotlinx.coroutines.test.TestScope +import org.junit.Assume.assumeFalse +import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -65,6 +69,16 @@ class AnimatorTestRuleToolkitTest { bitmapDiffer = screenshotRule, ) + @Before + fun setUp() { + // Do not run on Automotive. + assumeFalse( + InstrumentationRegistry.getInstrumentation().context.packageManager.hasSystemFeature( + PackageManager.FEATURE_AUTOMOTIVE + ) + ) + } + @Test fun recordFilmstrip_withAnimator() { val animatedBox = createScene() @@ -188,12 +202,7 @@ class AnimatorTestRuleToolkitTest { null } return motionRule.recordMotion( - AnimatorRuleRecordingSpec( - container, - motionControl, - sampleIntervalMs, - visualCapture, - ) { + AnimatorRuleRecordingSpec(container, motionControl, sampleIntervalMs, visualCapture) { feature(ViewFeatureCaptures.alpha, "alpha") } ) |