diff options
| author | 2018-08-21 02:25:10 +0000 | |
|---|---|---|
| committer | 2018-08-21 02:25:10 +0000 | |
| commit | 803df73e4540e92521c8e4a20aad809e5d079ae7 (patch) | |
| tree | 886262bc29f6da54720a1e3e587fc8cdebf126de | |
| parent | b80567bef6b96d0624499904276e7fd4bb36e8d7 (diff) | |
| parent | 7f9c16cd7a5099b176e3788ca779fddde12a04f0 (diff) | |
Merge "WM: Fix flaky DragDropControllerTests tests"
| -rw-r--r-- | services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java | 8 | 
1 files changed, 4 insertions, 4 deletions
diff --git a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java index f383fda0970f..7125246b6a29 100644 --- a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java +++ b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java @@ -23,6 +23,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;  import static org.junit.Assert.assertNotNull;  import static org.junit.Assert.assertTrue;  import static org.mockito.Mockito.any; +import static org.mockito.Mockito.doReturn;  import static org.mockito.Mockito.mock;  import static org.mockito.Mockito.spy;  import static org.mockito.Mockito.when; @@ -56,7 +57,7 @@ import java.util.concurrent.TimeUnit;  /**   * Tests for the {@link DragDropController} class.   * - * atest com.android.server.wm.DragDropControllerTests + * atest FrameworksServicesTests:com.android.server.wm.DragDropControllerTests   */  @SmallTest  @RunWith(AndroidJUnit4.class) @@ -118,7 +119,7 @@ public class DragDropControllerTests extends WindowTestsBase {          mTarget = new TestDragDropController(sWm, sWm.mH.getLooper());          mDisplayContent = spy(mDisplayContent);          mWindow = createDropTargetWindow("Drag test window", 0); -        when(mDisplayContent.getTouchableWinAtPointLocked(0, 0)).thenReturn(mWindow); +        doReturn(mWindow).when(mDisplayContent).getTouchableWinAtPointLocked(0, 0);          when(sWm.mInputManager.transferTouchFocus(any(), any())).thenReturn(true);          synchronized (sWm.mWindowMap) { @@ -159,8 +160,7 @@ public class DragDropControllerTests extends WindowTestsBase {      public void testPerformDrag_NullDataToOtherUser() throws Exception {          final WindowState otherUsersWindow =                  createDropTargetWindow("Other user's window", 1 * UserHandle.PER_USER_RANGE); -        when(mDisplayContent.getTouchableWinAtPointLocked(10, 10)) -                .thenReturn(otherUsersWindow); +        doReturn(otherUsersWindow).when(mDisplayContent).getTouchableWinAtPointLocked(10, 10);          dragFlow(0, null, 10, 10);      }  |