diff options
| author | 2025-01-05 18:41:55 -0800 | |
|---|---|---|
| committer | 2025-01-05 18:41:55 -0800 | |
| commit | 303654d92c46bf042c91a4959634f15c0d439eee (patch) | |
| tree | 88a41bfa31ce41598d6a44ba58b2fc60428fb38a | |
| parent | 848ed09bd755a23b0ff217f7cc0e6a38fc910d3b (diff) | |
| parent | c5c590d25f26218c5bb093006a0a8da58a866286 (diff) | |
Merge "Fix BackProgressAnimatorTest flake" into main
| -rw-r--r-- | libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java index bf54e79119bf..6d7a18d7fca4 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java @@ -187,14 +187,14 @@ public class BackProgressAnimatorTest { mTargetProgressCalled.await(1, TimeUnit.SECONDS); assertNotNull(mReceivedBackEvent); - // Trigger back invoked animation CountDownLatch finishCallbackCalled = new CountDownLatch(1); - InstrumentationRegistry.getInstrumentation().runOnMainSync( - () -> mProgressAnimator.onBackInvoked(finishCallbackCalled::countDown)); - - // remove onBackCancelled finishCallback (while progress is still animating to 0) - InstrumentationRegistry.getInstrumentation().runOnMainSync( - () -> mProgressAnimator.removeOnBackInvokedFinishCallback()); + // Trigger back invoked animation and remove onBackInvoked finishCallback (while progress + // is still animating to 1) + InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> { + mProgressAnimator.onBackInvoked(finishCallbackCalled::countDown); + mProgressAnimator.removeOnBackInvokedFinishCallback(); + } + ); // call reset (which triggers the finishCallback invocation, if one is present) InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> mProgressAnimator.reset()); |