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

Commit 082314d6 authored by Chandru S's avatar Chandru S
Browse files

Fix flaky motion tests

Bug: 375699622
Flag: com.android.systemui.compose_bouncer
Test: atest BouncerContentTest
Test: atest PaterrnBouncerTest
Change-Id: Ib856123e62bd92196a57d7a6556392bfefb66d6c
parent b55170e6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import com.android.systemui.motion.createSysUiComposeMotionTestRule
import com.android.systemui.res.R
import com.android.systemui.scene.domain.startable.sceneContainerStartable
import com.android.systemui.testKosmos
import kotlin.time.Duration.Companion.seconds
import org.junit.After
import org.junit.Before
import org.junit.Rule
@@ -109,7 +110,7 @@ class BouncerContentTest : SysuiTestCase() {

    @Test
    fun doubleClick_swapSide() =
        motionTestRule.runTest {
        motionTestRule.runTest(timeout = 30.seconds) {
            val motion =
                recordMotion(
                    content = { BouncerContentUnderTest() },
+3 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import com.android.systemui.haptics.msdl.bouncerHapticPlayer
import com.android.systemui.lifecycle.activateIn
import com.android.systemui.motion.createSysUiComposeMotionTestRule
import com.android.systemui.testKosmos
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.takeWhile
@@ -71,7 +72,7 @@ class PatternBouncerTest : SysuiTestCase() {

    @Test
    fun entryAnimation() =
        motionTestRule.runTest {
        motionTestRule.runTest(timeout = 30.seconds) {
            val motion =
                recordMotion(
                    content = { play -> if (play) PatternBouncerUnderTest() },
@@ -89,7 +90,7 @@ class PatternBouncerTest : SysuiTestCase() {

    @Test
    fun animateFailure() =
        motionTestRule.runTest {
        motionTestRule.runTest(timeout = 30.seconds) {
            val failureAnimationMotionControl =
                MotionControl(
                    delayReadyToPlay = {