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

Commit 5bafeec5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove tests for impossible conditions" into main

parents fab2be54 d8a114fe
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import static com.android.internal.jank.InteractionJankMonitor.Configuration.gen

import static com.google.common.truth.Truth.assertThat;

import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
@@ -190,25 +189,6 @@ public class InteractionJankMonitorTest {
        assertThat(generateSessionName(cujName, tooLongTag)).isEqualTo(expectedTrimmedName);
    }

    @Test
    public void validateConfiguration_surfaceOnlyAndNotDeferMonitor_throwsError() {
        Configuration.Builder builder = Configuration.Builder.withSurface(1,
                mActivity.getApplicationContext(), mSurfaceControl,
                mActivity.getMainThreadHandler()).setDeferMonitorForAnimationStart(false);

        assertThrows(IllegalStateException.class, builder::build);
    }

    @Test
    public void validateConfiguration_surfaceOnlyAndDeferMonitor_doesNotThrowError() {
        Configuration.Builder builder = Configuration.Builder.withSurface(1,
                mActivity.getApplicationContext(),
                mSurfaceControl, mActivity.getMainThreadHandler()).setDeferMonitorForAnimationStart(
                true);

        builder.build(); // no exception.
    }

    private InteractionJankMonitor createMockedInteractionJankMonitor() {
        InteractionJankMonitor monitor = spy(new InteractionJankMonitor(mWorker));
        doReturn(true).when(monitor).shouldMonitor();