Fixed
Status Update
Comments
tc...@google.com <tc...@google.com> #2
This bug/feature is targeting an iteration that has already passed. Can you please update the status or iteration? Thanks!
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 3ac4b80f723df87ed65e475badcba309e2438562
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Jan 06 11:22:38 2021
Move frame clock test methods to test-utils
Remove the experimental advance methods for ManualFrameClock to internal
test utils, and clean up a few usages of clock control that were
incorrect.
Also yields after advancing now, which is desirable in all cases.
Fixes: 170708374
Test: ./gradlew compose:foundation:foundation:cC && \
./gradlew compose:material:material:cC && \
./gradlew compose:ui:ui-test:cC
Relnote: "Removed experimental monotonicFrameAnimationClockOf methods"
Change-Id: Ib753f5d3cb77dabc7727f677a73bb7da8dae5fe2
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyColumnTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
A compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/AnimationClocks.kt
A compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/MockAnimationClock.kt
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/gesturescope/SendSwipeTest.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TestAnimationClock.kt
https://android-review.googlesource.com/1541367
Branch: androidx-main
commit 3ac4b80f723df87ed65e475badcba309e2438562
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Jan 06 11:22:38 2021
Move frame clock test methods to test-utils
Remove the experimental advance methods for ManualFrameClock to internal
test utils, and clean up a few usages of clock control that were
incorrect.
Also yields after advancing now, which is desirable in all cases.
Fixes: 170708374
Test: ./gradlew compose:foundation:foundation:cC && \
./gradlew compose:material:material:cC && \
./gradlew compose:ui:ui-test:cC
Relnote: "Removed experimental monotonicFrameAnimationClockOf methods"
Change-Id: Ib753f5d3cb77dabc7727f677a73bb7da8dae5fe2
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ScrollableTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyColumnTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SwipeableTest.kt
A compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/AnimationClocks.kt
A compose/test-utils/src/commonMain/kotlin/androidx/compose/testutils/MockAnimationClock.kt
M compose/ui/ui-test/api/current.txt
M compose/ui/ui-test/api/public_plus_experimental_current.txt
M compose/ui/ui-test/api/restricted_current.txt
M compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/gesturescope/SendSwipeTest.kt
M compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TestAnimationClock.kt
Description
If
ManualFrameClock.advanceClock(nanos: Long)
is called from the main dispatcher, and its awaiters are also dispatched on the main dispatcher, two subsequent calls toadvanceClock
without a suspending call in between will result in the second frame time being missed by the awaiting coroutines.When awaiters get their frame time, their withFrameNanos lambda runs and they will be resumed, but the resume happens dispatched. If the caller is already occupying the main thread, the dispatch is enqueued and can only happen when the caller suspends.
If we yield right after sending the new frame time, the awaiters can be dispatched and potentially suspend on another call to withFrameNanos before the caller of advanceClock moves on.