Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java +14 −8 Original line number Diff line number Diff line Loading @@ -315,14 +315,8 @@ public class WindowDecorationTests extends ShellTestCase { any(), eq(null) /* onDrawTransaction */); verify(mMockView).setTaskFocusState(true); verify(mMockWindowContainerTransaction).addInsetsSource( eq(taskInfo.token), any(), eq(0 /* index */), eq(WindowInsets.Type.captionBar()), eq(new Rect(100, 300, 400, 364)), any(), anyInt()); verifyAddedInsets(1, taskInfo.token, 0 /* index */, WindowInsets.Type.captionBar(), new Rect(100, 300, 400, 364)); if (Flags.enableFreeformBoxShadows()) { if (inSyncWithTransition) { Loading Loading @@ -1281,6 +1275,18 @@ public class WindowDecorationTests extends ShellTestCase { } } private void verifyAddedInsets(int times, WindowContainerToken token, int index, int type, Rect attachedRect) { if (com.android.window.flags.Flags.relativeInsets()) { verify(mMockWindowContainerTransaction, times(times)).addInsetsSource(eq(token), any(), eq(index), eq(type), eq(Insets.of(0, attachedRect.height(), 0, 0)), any(), anyInt()); } else { verify(mMockWindowContainerTransaction, times(times)).addInsetsSource(eq(token), any(), eq(index), eq(type), eq(attachedRect), any(), anyInt()); } } private static class TestView extends View implements TaskFocusStateConsumer { private TestView(Context context) { super(context); Loading Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java +14 −8 Original line number Diff line number Diff line Loading @@ -315,14 +315,8 @@ public class WindowDecorationTests extends ShellTestCase { any(), eq(null) /* onDrawTransaction */); verify(mMockView).setTaskFocusState(true); verify(mMockWindowContainerTransaction).addInsetsSource( eq(taskInfo.token), any(), eq(0 /* index */), eq(WindowInsets.Type.captionBar()), eq(new Rect(100, 300, 400, 364)), any(), anyInt()); verifyAddedInsets(1, taskInfo.token, 0 /* index */, WindowInsets.Type.captionBar(), new Rect(100, 300, 400, 364)); if (Flags.enableFreeformBoxShadows()) { if (inSyncWithTransition) { Loading Loading @@ -1281,6 +1275,18 @@ public class WindowDecorationTests extends ShellTestCase { } } private void verifyAddedInsets(int times, WindowContainerToken token, int index, int type, Rect attachedRect) { if (com.android.window.flags.Flags.relativeInsets()) { verify(mMockWindowContainerTransaction, times(times)).addInsetsSource(eq(token), any(), eq(index), eq(type), eq(Insets.of(0, attachedRect.height(), 0, 0)), any(), anyInt()); } else { verify(mMockWindowContainerTransaction, times(times)).addInsetsSource(eq(token), any(), eq(index), eq(type), eq(attachedRect), any(), anyInt()); } } private static class TestView extends View implements TaskFocusStateConsumer { private TestView(Context context) { super(context); Loading