Loading services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java +0 −10 Original line number Diff line number Diff line Loading @@ -217,16 +217,6 @@ public class DragDropControllerTests extends WindowTestsBase { doDragAndDrop(View.DRAG_FLAG_GLOBAL | View.DRAG_FLAG_GLOBAL_URI_READ, null, 0, 0); } @Test public void testPerformDrag_NullDataToOtherUser() { final WindowState otherUsersWindow = createDropTargetWindow("Other user's window", 1 * UserHandle.PER_USER_RANGE); doReturn(otherUsersWindow).when(mDisplayContent).getTouchableWinAtPointLocked(10, 10); doDragAndDrop(View.DRAG_FLAG_GLOBAL | View.DRAG_FLAG_GLOBAL_URI_READ, null, 10, 10); mToken = otherUsersWindow.mClient.asBinder(); } @Test public void testPrivateInterceptGlobalDragDropFlagChecksPermission() { DisplayPolicy policy = mDisplayContent.getDisplayPolicy(); Loading services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java +9 −10 Original line number Diff line number Diff line Loading @@ -139,7 +139,6 @@ public class SystemServicesTestRule implements TestRule { private ActivityTaskManagerService mAtmService; private WindowManagerService mWmService; private InputManagerService mImService; private InputChannel mInputChannel; private Runnable mOnBeforeServicesCreated; /** * Spied {@link SurfaceControl.Transaction} class than can be used to verify calls. Loading Loading @@ -326,12 +325,15 @@ public class SystemServicesTestRule implements TestRule { // InputManagerService mImService = mock(InputManagerService.class); // InputChannel cannot be mocked because it may pass to InputEventReceiver. final InputChannel[] inputChannels = InputChannel.openInputChannelPair(TAG); inputChannels[0].dispose(); mInputChannel = inputChannels[1]; doReturn(mInputChannel).when(mImService).monitorInput(anyString(), anyInt()); doReturn(mInputChannel).when(mImService).createInputChannel(anyString()); // InputChannel cannot be mocked because it may be passed to InputEventReceiver. Answer<InputChannel> newInputChannel = invocation -> { String name = invocation.getArgument(0); final InputChannel[] channels = InputChannel.openInputChannelPair(name); channels[0].dispose(); return channels[1]; }; when(mImService.monitorInput(anyString(), anyInt())).thenAnswer(newInputChannel); when(mImService.createInputChannel(anyString())).thenAnswer(newInputChannel); // StatusBarManagerInternal final StatusBarManagerInternal sbmi = mock(StatusBarManagerInternal.class); Loading Loading @@ -464,9 +466,6 @@ public class SystemServicesTestRule implements TestRule { SurfaceAnimationThread.dispose(); AnimationThread.dispose(); UiThread.dispose(); if (mInputChannel != null) { mInputChannel.dispose(); } tearDownLocalServices(); // Reset priority booster because animation thread has been changed. Loading Loading
services/tests/wmtests/src/com/android/server/wm/DragDropControllerTests.java +0 −10 Original line number Diff line number Diff line Loading @@ -217,16 +217,6 @@ public class DragDropControllerTests extends WindowTestsBase { doDragAndDrop(View.DRAG_FLAG_GLOBAL | View.DRAG_FLAG_GLOBAL_URI_READ, null, 0, 0); } @Test public void testPerformDrag_NullDataToOtherUser() { final WindowState otherUsersWindow = createDropTargetWindow("Other user's window", 1 * UserHandle.PER_USER_RANGE); doReturn(otherUsersWindow).when(mDisplayContent).getTouchableWinAtPointLocked(10, 10); doDragAndDrop(View.DRAG_FLAG_GLOBAL | View.DRAG_FLAG_GLOBAL_URI_READ, null, 10, 10); mToken = otherUsersWindow.mClient.asBinder(); } @Test public void testPrivateInterceptGlobalDragDropFlagChecksPermission() { DisplayPolicy policy = mDisplayContent.getDisplayPolicy(); Loading
services/tests/wmtests/src/com/android/server/wm/SystemServicesTestRule.java +9 −10 Original line number Diff line number Diff line Loading @@ -139,7 +139,6 @@ public class SystemServicesTestRule implements TestRule { private ActivityTaskManagerService mAtmService; private WindowManagerService mWmService; private InputManagerService mImService; private InputChannel mInputChannel; private Runnable mOnBeforeServicesCreated; /** * Spied {@link SurfaceControl.Transaction} class than can be used to verify calls. Loading Loading @@ -326,12 +325,15 @@ public class SystemServicesTestRule implements TestRule { // InputManagerService mImService = mock(InputManagerService.class); // InputChannel cannot be mocked because it may pass to InputEventReceiver. final InputChannel[] inputChannels = InputChannel.openInputChannelPair(TAG); inputChannels[0].dispose(); mInputChannel = inputChannels[1]; doReturn(mInputChannel).when(mImService).monitorInput(anyString(), anyInt()); doReturn(mInputChannel).when(mImService).createInputChannel(anyString()); // InputChannel cannot be mocked because it may be passed to InputEventReceiver. Answer<InputChannel> newInputChannel = invocation -> { String name = invocation.getArgument(0); final InputChannel[] channels = InputChannel.openInputChannelPair(name); channels[0].dispose(); return channels[1]; }; when(mImService.monitorInput(anyString(), anyInt())).thenAnswer(newInputChannel); when(mImService.createInputChannel(anyString())).thenAnswer(newInputChannel); // StatusBarManagerInternal final StatusBarManagerInternal sbmi = mock(StatusBarManagerInternal.class); Loading Loading @@ -464,9 +466,6 @@ public class SystemServicesTestRule implements TestRule { SurfaceAnimationThread.dispose(); AnimationThread.dispose(); UiThread.dispose(); if (mInputChannel != null) { mInputChannel.dispose(); } tearDownLocalServices(); // Reset priority booster because animation thread has been changed. Loading