Fix tests
Test: atest InsetsAnimationControlImplTest Bug: 118118435 Change-Id: I92f5a91b24d3441c092c9dab55d9340b7da3ab14
This commit is contained in:
@@ -122,7 +122,8 @@ public class InsetsAnimationControlImpl implements WindowInsetsAnimationControll
|
||||
mController.scheduleApplyChangeInsets();
|
||||
}
|
||||
|
||||
void applyChangeInsets(InsetsState state) {
|
||||
@VisibleForTesting
|
||||
public void applyChangeInsets(InsetsState state) {
|
||||
final Insets offset = Insets.subtract(mShownInsets, mPendingInsets);
|
||||
ArrayList<SurfaceParams> params = new ArrayList<>();
|
||||
if (offset.left != 0) {
|
||||
|
||||
@@ -223,15 +223,18 @@ public class InsetsController implements WindowInsetsController {
|
||||
mState.dump(prefix + " ", pw);
|
||||
}
|
||||
|
||||
void dispatchAnimationStarted(WindowInsetsAnimationListener.InsetsAnimation animation) {
|
||||
@VisibleForTesting
|
||||
public void dispatchAnimationStarted(WindowInsetsAnimationListener.InsetsAnimation animation) {
|
||||
mViewRoot.mView.dispatchWindowInsetsAnimationStarted(animation);
|
||||
}
|
||||
|
||||
void dispatchAnimationFinished(WindowInsetsAnimationListener.InsetsAnimation animation) {
|
||||
@VisibleForTesting
|
||||
public void dispatchAnimationFinished(WindowInsetsAnimationListener.InsetsAnimation animation) {
|
||||
mViewRoot.mView.dispatchWindowInsetsAnimationFinished(animation);
|
||||
}
|
||||
|
||||
void scheduleApplyChangeInsets() {
|
||||
@VisibleForTesting
|
||||
public void scheduleApplyChangeInsets() {
|
||||
if (!mAnimCallbackScheduled) {
|
||||
mViewRoot.mChoreographer.postCallback(Choreographer.CALLBACK_INSETS_ANIMATION,
|
||||
mAnimCallback, null /* token*/);
|
||||
|
||||
@@ -98,6 +98,7 @@ public class InsetsAnimationControlImplTest {
|
||||
@Test
|
||||
public void testChangeInsets() {
|
||||
mController.changeInsets(Insets.of(0, 30, 40, 0));
|
||||
mController.applyChangeInsets(new InsetsState());
|
||||
assertEquals(Insets.of(0, 30, 40, 0), mController.getCurrentInsets());
|
||||
|
||||
ArgumentCaptor<SurfaceParams> captor = ArgumentCaptor.forClass(SurfaceParams.class);
|
||||
|
||||
Reference in New Issue
Block a user