Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java +7 −7 Original line number Original line Diff line number Diff line Loading @@ -187,14 +187,14 @@ public class BackProgressAnimatorTest { mTargetProgressCalled.await(1, TimeUnit.SECONDS); mTargetProgressCalled.await(1, TimeUnit.SECONDS); assertNotNull(mReceivedBackEvent); assertNotNull(mReceivedBackEvent); // Trigger back invoked animation CountDownLatch finishCallbackCalled = new CountDownLatch(1); CountDownLatch finishCallbackCalled = new CountDownLatch(1); InstrumentationRegistry.getInstrumentation().runOnMainSync( // Trigger back invoked animation and remove onBackInvoked finishCallback (while progress () -> mProgressAnimator.onBackInvoked(finishCallbackCalled::countDown)); // is still animating to 1) InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> { // remove onBackCancelled finishCallback (while progress is still animating to 0) mProgressAnimator.onBackInvoked(finishCallbackCalled::countDown); InstrumentationRegistry.getInstrumentation().runOnMainSync( mProgressAnimator.removeOnBackInvokedFinishCallback(); () -> mProgressAnimator.removeOnBackInvokedFinishCallback()); } ); // call reset (which triggers the finishCallback invocation, if one is present) // call reset (which triggers the finishCallback invocation, if one is present) InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> mProgressAnimator.reset()); InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> mProgressAnimator.reset()); Loading Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/back/BackProgressAnimatorTest.java +7 −7 Original line number Original line Diff line number Diff line Loading @@ -187,14 +187,14 @@ public class BackProgressAnimatorTest { mTargetProgressCalled.await(1, TimeUnit.SECONDS); mTargetProgressCalled.await(1, TimeUnit.SECONDS); assertNotNull(mReceivedBackEvent); assertNotNull(mReceivedBackEvent); // Trigger back invoked animation CountDownLatch finishCallbackCalled = new CountDownLatch(1); CountDownLatch finishCallbackCalled = new CountDownLatch(1); InstrumentationRegistry.getInstrumentation().runOnMainSync( // Trigger back invoked animation and remove onBackInvoked finishCallback (while progress () -> mProgressAnimator.onBackInvoked(finishCallbackCalled::countDown)); // is still animating to 1) InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> { // remove onBackCancelled finishCallback (while progress is still animating to 0) mProgressAnimator.onBackInvoked(finishCallbackCalled::countDown); InstrumentationRegistry.getInstrumentation().runOnMainSync( mProgressAnimator.removeOnBackInvokedFinishCallback(); () -> mProgressAnimator.removeOnBackInvokedFinishCallback()); } ); // call reset (which triggers the finishCallback invocation, if one is present) // call reset (which triggers the finishCallback invocation, if one is present) InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> mProgressAnimator.reset()); InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> mProgressAnimator.reset()); Loading