diff options
-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()); |