diff options
| author | 2024-05-06 14:28:26 +0000 | |
|---|---|---|
| committer | 2024-05-06 14:28:26 +0000 | |
| commit | 7bb9b7e3ec70a337197fc43bad6ea4fb43e792b3 (patch) | |
| tree | 83ebc57b30a31e26c911737706927c12be3823ec | |
| parent | 89af38a609ceda394235876fb58801fbe6ffc38f (diff) | |
| parent | d1da678830d769eb62f328d97868f981c5e893f8 (diff) | |
Merge "Adopt changes in MotionTestRule API" into main
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/animation/TransitionAnimatorTest.kt | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/packages/SystemUI/tests/src/com/android/systemui/animation/TransitionAnimatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/animation/TransitionAnimatorTest.kt index fbe11847f3d3..e64df905470d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/animation/TransitionAnimatorTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/animation/TransitionAnimatorTest.kt @@ -28,10 +28,13 @@ import com.android.systemui.activity.EmptyTestActivity import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith +import platform.test.motion.MotionTestRule import platform.test.motion.RecordedMotion -import platform.test.motion.Sampling.Companion.evenlySampled +import platform.test.motion.view.AnimationSampling.Companion.evenlySampled import platform.test.motion.view.DrawableFeatureCaptures -import platform.test.motion.view.ViewMotionTestRule +import platform.test.motion.view.ViewRecordingSpec.Companion.captureWithoutScreenshot +import platform.test.motion.view.ViewToolkit +import platform.test.motion.view.record import platform.test.screenshot.DeviceEmulationRule import platform.test.screenshot.DeviceEmulationSpec import platform.test.screenshot.DisplaySpec @@ -64,7 +67,8 @@ class TransitionAnimatorTest : SysuiTestCase() { @get:Rule(order = 0) val deviceEmulationRule = DeviceEmulationRule(emulationSpec) @get:Rule(order = 1) val activityRule = ActivityScenarioRule(EmptyTestActivity::class.java) - @get:Rule(order = 2) val motionRule = ViewMotionTestRule(pathManager, { activityRule.scenario }) + @get:Rule(order = 2) + val motionRule = MotionTestRule(ViewToolkit { activityRule.scenario }, pathManager) @Test fun backgroundAnimation_whenLaunching() { @@ -151,15 +155,14 @@ class TransitionAnimatorTest : SysuiTestCase() { backgroundLayer: GradientDrawable, animator: AnimatorSet ): RecordedMotion { - return motionRule.checkThat(animator).record( - backgroundLayer, - evenlySampled(20), - visualCapture = null - ) { - capture(DrawableFeatureCaptures.bounds, "bounds") - capture(DrawableFeatureCaptures.cornerRadii, "corner_radii") - capture(DrawableFeatureCaptures.alpha, "alpha") - } + return motionRule.record( + animator, + backgroundLayer.captureWithoutScreenshot(evenlySampled(20)) { + feature(DrawableFeatureCaptures.bounds, "bounds") + feature(DrawableFeatureCaptures.cornerRadii, "corner_radii") + feature(DrawableFeatureCaptures.alpha, "alpha") + } + ) } } |