From e59da0bd15ce6cbc8bf7af462cada1b8d2a99a36 Mon Sep 17 00:00:00 2001 From: Mike Schneider Date: Thu, 12 Sep 2024 12:06:38 +0200 Subject: Reset display settings applied via [DeviceEmulationRule] This fixes flakiness on other STL tests, that implicitly depend on the devices' resolution. Test: AnchoredSizeTest Flag: TEST_ONLY Bug: 366151530 Change-Id: I5a2645a2b6e13c7d90d9a1edda616e72f079a7ef --- .../compose/animation/scene/transformation/AnchoredSizeTest.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt index de55e2fb7657..ea6f208d6bb9 100644 --- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt +++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt @@ -31,16 +31,23 @@ import com.android.compose.animation.scene.TransitionBuilder import com.android.compose.animation.scene.TransitionRecordingSpec import com.android.compose.animation.scene.featureOfElement import com.android.compose.animation.scene.recordTransition +import org.junit.ClassRule import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import platform.test.motion.compose.ComposeFeatureCaptures import platform.test.motion.compose.createComposeMotionTestRule import platform.test.motion.testing.createGoldenPathManager +import platform.test.screenshot.ResetDeviceEmulationRule @RunWith(AndroidJUnit4::class) @MotionTest class AnchoredSizeTest { + + companion object { + @JvmField @ClassRule val cleanupRule: ResetDeviceEmulationRule = ResetDeviceEmulationRule() + } + private val goldenPaths = createGoldenPathManager("frameworks/base/packages/SystemUI/compose/scene/tests/goldens") -- cgit v1.2.3-59-g8ed1b