Loading packages/SystemUI/tests/src/com/android/systemui/animation/TransitionAnimatorTest.kt +15 −12 Original line number Original line Diff line number Diff line Loading @@ -28,10 +28,13 @@ import com.android.systemui.activity.EmptyTestActivity 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 import platform.test.motion.MotionTestRule import platform.test.motion.RecordedMotion 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.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.DeviceEmulationRule import platform.test.screenshot.DeviceEmulationSpec import platform.test.screenshot.DeviceEmulationSpec import platform.test.screenshot.DisplaySpec import platform.test.screenshot.DisplaySpec Loading Loading @@ -64,7 +67,8 @@ class TransitionAnimatorTest : SysuiTestCase() { @get:Rule(order = 0) val deviceEmulationRule = DeviceEmulationRule(emulationSpec) @get:Rule(order = 0) val deviceEmulationRule = DeviceEmulationRule(emulationSpec) @get:Rule(order = 1) val activityRule = ActivityScenarioRule(EmptyTestActivity::class.java) @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 @Test fun backgroundAnimation_whenLaunching() { fun backgroundAnimation_whenLaunching() { Loading Loading @@ -151,15 +155,14 @@ class TransitionAnimatorTest : SysuiTestCase() { backgroundLayer: GradientDrawable, backgroundLayer: GradientDrawable, animator: AnimatorSet animator: AnimatorSet ): RecordedMotion { ): RecordedMotion { return motionRule.checkThat(animator).record( return motionRule.record( backgroundLayer, animator, evenlySampled(20), backgroundLayer.captureWithoutScreenshot(evenlySampled(20)) { visualCapture = null feature(DrawableFeatureCaptures.bounds, "bounds") ) { feature(DrawableFeatureCaptures.cornerRadii, "corner_radii") capture(DrawableFeatureCaptures.bounds, "bounds") feature(DrawableFeatureCaptures.alpha, "alpha") capture(DrawableFeatureCaptures.cornerRadii, "corner_radii") capture(DrawableFeatureCaptures.alpha, "alpha") } } ) } } } } Loading Loading
packages/SystemUI/tests/src/com/android/systemui/animation/TransitionAnimatorTest.kt +15 −12 Original line number Original line Diff line number Diff line Loading @@ -28,10 +28,13 @@ import com.android.systemui.activity.EmptyTestActivity 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 import platform.test.motion.MotionTestRule import platform.test.motion.RecordedMotion 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.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.DeviceEmulationRule import platform.test.screenshot.DeviceEmulationSpec import platform.test.screenshot.DeviceEmulationSpec import platform.test.screenshot.DisplaySpec import platform.test.screenshot.DisplaySpec Loading Loading @@ -64,7 +67,8 @@ class TransitionAnimatorTest : SysuiTestCase() { @get:Rule(order = 0) val deviceEmulationRule = DeviceEmulationRule(emulationSpec) @get:Rule(order = 0) val deviceEmulationRule = DeviceEmulationRule(emulationSpec) @get:Rule(order = 1) val activityRule = ActivityScenarioRule(EmptyTestActivity::class.java) @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 @Test fun backgroundAnimation_whenLaunching() { fun backgroundAnimation_whenLaunching() { Loading Loading @@ -151,15 +155,14 @@ class TransitionAnimatorTest : SysuiTestCase() { backgroundLayer: GradientDrawable, backgroundLayer: GradientDrawable, animator: AnimatorSet animator: AnimatorSet ): RecordedMotion { ): RecordedMotion { return motionRule.checkThat(animator).record( return motionRule.record( backgroundLayer, animator, evenlySampled(20), backgroundLayer.captureWithoutScreenshot(evenlySampled(20)) { visualCapture = null feature(DrawableFeatureCaptures.bounds, "bounds") ) { feature(DrawableFeatureCaptures.cornerRadii, "corner_radii") capture(DrawableFeatureCaptures.bounds, "bounds") feature(DrawableFeatureCaptures.alpha, "alpha") capture(DrawableFeatureCaptures.cornerRadii, "corner_radii") capture(DrawableFeatureCaptures.alpha, "alpha") } } ) } } } } Loading