From b60f182a6879c0b212cae83d61ed342a75fcad81 Mon Sep 17 00:00:00 2001 From: Nick Chameyev Date: Wed, 21 Dec 2022 11:49:09 +0000 Subject: [PATCH] Fix broken FoldAodAnimationControllerTest test Execute main thread executor runnables in the correct order in the test. Bug: 262889647 Test: atest com.android.systemui.unfold.FoldAodAnimationControllerTest Change-Id: Ifbae4c291cd45d60cb8393a7bace616fb5d3331f --- .../android/systemui/unfold/FoldAodAnimationControllerTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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())