Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6ad7cd0 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "frameworks/base: remove usages of Mockito.verifyZeroInteractions" into main

parents 3b168dee ef91a994
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;

import android.hardware.usb.UsbDevice;
import android.platform.test.annotations.RequiresFlagsEnabled;
@@ -118,6 +118,6 @@ public class BrailleDisplayControllerImplTest {

        verify(mBrailleDisplayCallback).onConnectionFailed(
                BrailleDisplayController.BrailleDisplayCallback.FLAG_ERROR_CANNOT_ACCESS);
        verifyZeroInteractions(mAccessibilityServiceConnection);
        verifyNoMoreInteractions(mAccessibilityServiceConnection);
    }
}
+3 −3
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ public class DisplayManagerGlobalTest {
                        /* isEventFilterExplicit */ true);
        callback.onDisplayEvent(displayId, DisplayManagerGlobal.EVENT_DISPLAY_ADDED);
        waitForHandler();
        Mockito.verifyZeroInteractions(mDisplayListener);
        Mockito.verifyNoMoreInteractions(mDisplayListener);

        mDisplayManagerGlobal.registerDisplayListener(mDisplayListener, mHandler,
                ALL_DISPLAY_EVENTS
@@ -272,7 +272,7 @@ public class DisplayManagerGlobalTest {
                        /* isEventFilterExplicit */ true);
        callback.onDisplayEvent(displayId, DisplayManagerGlobal.EVENT_DISPLAY_BASIC_CHANGED);
        waitForHandler();
        Mockito.verifyZeroInteractions(mDisplayListener);
        Mockito.verifyNoMoreInteractions(mDisplayListener);

        mDisplayManagerGlobal.registerDisplayListener(mDisplayListener, mHandler,
                ALL_DISPLAY_EVENTS
@@ -280,7 +280,7 @@ public class DisplayManagerGlobalTest {
                        /* isEventFilterExplicit */ true);
        callback.onDisplayEvent(displayId, DisplayManagerGlobal.EVENT_DISPLAY_REMOVED);
        waitForHandler();
        Mockito.verifyZeroInteractions(mDisplayListener);
        Mockito.verifyNoMoreInteractions(mDisplayListener);
    }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;

import android.os.CancellationSignal;
@@ -230,7 +230,7 @@ public class PendingInsetsControllerTest {
        InsetsController secondController = mock(InsetsController.class);
        mPendingInsetsController.replayAndAttach(secondController);
        verify(mReplayedController).show(eq(systemBars()));
        verifyZeroInteractions(secondController);
        verifyNoMoreInteractions(secondController);
    }

    @Test
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.MockitoAnnotations.initMocks;

import android.os.Bundle;
@@ -74,7 +74,7 @@ public class AccessibilityInteractionClientTest {
                MOCK_CONNECTION_ID, windowId, accessibilityNodeId, true, 0, null);
        assertEquals("Node got lost along the way", nodeFromConnection, node);

        verifyZeroInteractions(mMockCache);
        verifyNoMoreInteractions(mMockCache);
    }

    @Test
+22 −22
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;

import android.content.ComponentName;
import android.content.ContentCaptureOptions;
@@ -130,7 +130,7 @@ public class MainContentCaptureSessionTest {
        mTestableLooper.processAllMessages();

        assertThat(session.mContentProtectionEventProcessor).isNull();
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
    }

    @Test
@@ -151,7 +151,7 @@ public class MainContentCaptureSessionTest {
        mTestableLooper.processAllMessages();

        assertThat(session.mContentProtectionEventProcessor).isNull();
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
    }

    @Test
@@ -172,7 +172,7 @@ public class MainContentCaptureSessionTest {
        mTestableLooper.processAllMessages();

        assertThat(session.mContentProtectionEventProcessor).isNull();
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
    }

    @Test
@@ -197,7 +197,7 @@ public class MainContentCaptureSessionTest {
        session.sendEvent(EVENT);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isNull();
    }

@@ -227,7 +227,7 @@ public class MainContentCaptureSessionTest {
        session.sendEvent(EVENT);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isNotNull();
        assertThat(session.mEvents).containsExactly(EVENT);
    }
@@ -255,7 +255,7 @@ public class MainContentCaptureSessionTest {
        session.sendEvent(EVENT);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isNull();
    }

@@ -272,8 +272,8 @@ public class MainContentCaptureSessionTest {
        session.flush(REASON);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyZeroInteractions(mMockContentCaptureDirectManager);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentCaptureDirectManager);
        assertThat(session.mEvents).containsExactly(EVENT);
    }

@@ -289,8 +289,8 @@ public class MainContentCaptureSessionTest {
        session.flush(REASON);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyZeroInteractions(mMockContentCaptureDirectManager);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentCaptureDirectManager);
        assertThat(session.mEvents).containsExactly(EVENT);
    }

@@ -307,7 +307,7 @@ public class MainContentCaptureSessionTest {
        session.flush(REASON);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isEmpty();
        assertEventFlushedContentCapture(options);
    }
@@ -325,7 +325,7 @@ public class MainContentCaptureSessionTest {
        session.flush(REASON);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isEmpty();
        assertEventFlushedContentCapture(options);
    }
@@ -339,7 +339,7 @@ public class MainContentCaptureSessionTest {
        mTestableLooper.processAllMessages();

        verify(mMockSystemServerInterface).finishSession(anyInt());
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mDirectServiceInterface).isNull();
        assertThat(session.mContentProtectionEventProcessor).isNull();
    }
@@ -352,8 +352,8 @@ public class MainContentCaptureSessionTest {
        session.resetSession(/* newState= */ 0);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockSystemServerInterface);
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockSystemServerInterface);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mDirectServiceInterface).isNull();
        assertThat(session.mContentProtectionEventProcessor).isNull();
    }
@@ -370,8 +370,8 @@ public class MainContentCaptureSessionTest {
        notifyContentCaptureEvents(session);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentCaptureDirectManager);
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentCaptureDirectManager);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isNull();
    }

@@ -388,8 +388,8 @@ public class MainContentCaptureSessionTest {
        notifyContentCaptureEvents(session);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentCaptureDirectManager);
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentCaptureDirectManager);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isNull();
    }

@@ -407,8 +407,8 @@ public class MainContentCaptureSessionTest {
        notifyContentCaptureEvents(session);
        mTestableLooper.processAllMessages();

        verifyZeroInteractions(mMockContentCaptureDirectManager);
        verifyZeroInteractions(mMockContentProtectionEventProcessor);
        verifyNoMoreInteractions(mMockContentCaptureDirectManager);
        verifyNoMoreInteractions(mMockContentProtectionEventProcessor);
        assertThat(session.mEvents).isNull();
    }

Loading