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 30c4f97e5503f..f4226bcd71c31 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/unfold/FoldAodAnimationControllerTest.kt @@ -175,8 +175,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())