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

Commit 90eb985c authored by Mike Schneider's avatar Mike Schneider Committed by Android (Google) Code Review
Browse files

Merge "Fix awaitFrames waiting for one frame too few" into main

parents 252cd499 c3a8ba70
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ class TransitionAnimatorTest(
            sampleIntervalMs = 16L
        } else {
            assertTrue { animation is TransitionAnimator.InterpolatedAnimation }
            motionControl = MotionControl { awaitFrames(count = 26) }
            motionControl = MotionControl { awaitFrames(count = 25) }
            sampleIntervalMs = 20L
        }

+11 −11
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ private class MotionControlImpl(
    }

    override suspend fun awaitFrames(count: Int) {
        onFrame.take(count).collect {}
        onFrame.take(count + 1).collect {}
    }

    private fun MotionControlFn.launch(): Job {
+2 −2
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ class AnimatorTestRuleToolkitTest {
        val recordedMotion =
            record(
                animatedBox,
                MotionControl { awaitFrames(count = 26) },
                MotionControl { awaitFrames(count = 25) },
                sampleIntervalMs = 20L,
                recordScreenshots = true,
            )
@@ -103,7 +103,7 @@ class AnimatorTestRuleToolkitTest {
        val recordedMotion =
            record(
                animatedBox,
                MotionControl { awaitFrames(count = 26) },
                MotionControl { awaitFrames(count = 25) },
                sampleIntervalMs = 20L,
                recordScreenshots = false,
            )