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

Commit 5978f56d authored by Josh Tsuji's avatar Josh Tsuji Committed by Android (Google) Code Review
Browse files

Merge "Fix occassional CME in physics tests."

parents 48028d15 ba5f0fe3
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -236,6 +236,14 @@ object PhysicsAnimatorTestUtils {
        vararg additionalUpdateMatchers: UpdateMatcher
    ) {
        val updateFrames: UpdateFramesPerProperty<T> = getAnimationUpdateFrames(animator)

        if (!updateFrames.containsKey(property)) {
            error("No frames for given target object and property.")
        }

        // Copy the frames to avoid a ConcurrentModificationException if the animation update
        // listeners attempt to add a new frame while we're verifying these.
        val framesForProperty = ArrayList(updateFrames[property]!!)
        val matchers = ArrayDeque<UpdateMatcher>(
                additionalUpdateMatchers.toList())
        val frameTraceMessage = StringBuilder()
@@ -243,8 +251,7 @@ object PhysicsAnimatorTestUtils {
        var curMatcher = firstUpdateMatcher

        // Loop through the updates from the testable animator.
        for (update in updateFrames[property]
                ?: error("No frames for given target object and property.")) {
        for (update in framesForProperty) {

            // Check whether this frame satisfies the current matcher.
            if (curMatcher(update)) {