diff --git a/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt index 89402de792dc1..b5355f63519fe 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt @@ -171,8 +171,10 @@ class FoldAodAnimationControllerTest : SysuiTestCase() { fold() underTest.onScreenTurningOn({}) - underTest.onStartedWakingUp() + // The body of onScreenTurningOn is executed on fakeExecutor, + // run all pending tasks before calling the next method fakeExecutor.runAllReady() + underTest.onStartedWakingUp() verify(latencyTracker).onActionStart(any()) verify(latencyTracker).onActionCancel(any())