Loading core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java +14 −9 Original line number Diff line number Diff line Loading @@ -103,15 +103,7 @@ public class WindowOnBackInvokedDispatcherTest { private int mCallbackInfoCalls = 0; private final BackMotionEvent mBackEvent = new BackMotionEvent( /* touchX = */ 0, /* touchY = */ 0, /* progress = */ 0, /* velocityX = */ 0, /* velocityY = */ 0, /* triggerBack = */ false, /* swipeEdge = */ BackEvent.EDGE_LEFT, /* departingAnimationTarget = */ null); private final BackMotionEvent mBackEvent = backMotionEventFrom(/* progress */ 0f); private final MotionEvent mMotionEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 100, 100, 0); Loading Loading @@ -558,6 +550,7 @@ public class WindowOnBackInvokedDispatcherTest { OnBackInvokedCallbackInfo callbackInfo = assertSetCallbackInfo(); callbackInfo.getCallback().onBackStarted(mBackEvent); callbackInfo.getCallback().onBackProgressed(backMotionEventFrom(/* progress */ 0.5f)); waitForIdle(); assertTrue(mDispatcher.mProgressAnimator.isBackAnimationInProgress()); Loading @@ -575,6 +568,18 @@ public class WindowOnBackInvokedDispatcherTest { assertFalse(mDispatcher.mProgressAnimator.isBackAnimationInProgress()); } private BackMotionEvent backMotionEventFrom(float progress) { return new BackMotionEvent( /* touchX = */ 0, /* touchY = */ 0, /* progress = */ progress, /* velocityX = */ 0, /* velocityY = */ 0, /* triggerBack = */ false, /* swipeEdge = */ BackEvent.EDGE_LEFT, /* departingAnimationTarget = */ null); } private void verifyImeCallackRegistrations() throws RemoteException { // verify default callback is replaced with ImeBackAnimationController mDispatcher.registerOnBackInvokedCallbackUnchecked(mDefaultImeCallback, PRIORITY_DEFAULT); Loading Loading
core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java +14 −9 Original line number Diff line number Diff line Loading @@ -103,15 +103,7 @@ public class WindowOnBackInvokedDispatcherTest { private int mCallbackInfoCalls = 0; private final BackMotionEvent mBackEvent = new BackMotionEvent( /* touchX = */ 0, /* touchY = */ 0, /* progress = */ 0, /* velocityX = */ 0, /* velocityY = */ 0, /* triggerBack = */ false, /* swipeEdge = */ BackEvent.EDGE_LEFT, /* departingAnimationTarget = */ null); private final BackMotionEvent mBackEvent = backMotionEventFrom(/* progress */ 0f); private final MotionEvent mMotionEvent = MotionEvent.obtain(0, 0, MotionEvent.ACTION_MOVE, 100, 100, 0); Loading Loading @@ -558,6 +550,7 @@ public class WindowOnBackInvokedDispatcherTest { OnBackInvokedCallbackInfo callbackInfo = assertSetCallbackInfo(); callbackInfo.getCallback().onBackStarted(mBackEvent); callbackInfo.getCallback().onBackProgressed(backMotionEventFrom(/* progress */ 0.5f)); waitForIdle(); assertTrue(mDispatcher.mProgressAnimator.isBackAnimationInProgress()); Loading @@ -575,6 +568,18 @@ public class WindowOnBackInvokedDispatcherTest { assertFalse(mDispatcher.mProgressAnimator.isBackAnimationInProgress()); } private BackMotionEvent backMotionEventFrom(float progress) { return new BackMotionEvent( /* touchX = */ 0, /* touchY = */ 0, /* progress = */ progress, /* velocityX = */ 0, /* velocityY = */ 0, /* triggerBack = */ false, /* swipeEdge = */ BackEvent.EDGE_LEFT, /* departingAnimationTarget = */ null); } private void verifyImeCallackRegistrations() throws RemoteException { // verify default callback is replaced with ImeBackAnimationController mDispatcher.registerOnBackInvokedCallbackUnchecked(mDefaultImeCallback, PRIORITY_DEFAULT); Loading