Add missing @DoNotInstrument annotations

PiperOrigin-RevId: 377006047
This commit is contained in:
kimvde 2021-06-02 09:10:47 +01:00 committed by bachinger
parent 1dddb8eb1e
commit fc47c2fe86
24 changed files with 48 additions and 0 deletions

View File

@ -84,9 +84,11 @@ import org.mockito.Captor;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Tests for {@link CastPlayer}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class CastPlayerTest {
private CastPlayer castPlayer;

View File

@ -29,9 +29,11 @@ import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Tests for {@link CastTimelineTracker}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class CastTimelineTrackerTest {
private static final long DURATION_2_MS = 2000;

View File

@ -23,9 +23,11 @@ import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.source.TrackGroup;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Test for {@link CastTrackSelection}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class CastTrackSelectionTest {
private static final TrackGroup TRACK_GROUP =

View File

@ -27,9 +27,11 @@ import com.google.android.gms.cast.MediaQueueItem;
import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Test for {@link DefaultMediaItemConverter}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class DefaultMediaItemConverterTest {
@Test

View File

@ -27,11 +27,13 @@ import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.util.MimeTypes;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/**
* Unit test for creating SmoothStreaming media sources with the {@link DefaultMediaSourceFactory}.
*/
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class DefaultMediaSourceFactoryTest {
private static final String URI_MEDIA = "http://exoplayer.dev/video";

View File

@ -37,9 +37,11 @@ import com.google.android.exoplayer2.upstream.TransferListener;
import com.google.android.exoplayer2.util.MimeTypes;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit tests for {@link SsMediaPeriod}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class SsMediaPeriodTest {
@Test

View File

@ -25,9 +25,11 @@ import com.google.android.exoplayer2.upstream.FileDataSource;
import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit tests for {@link SsMediaSource}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class SsMediaSourceTest {
// Tests backwards compatibility

View File

@ -22,9 +22,11 @@ import com.google.android.exoplayer2.testutil.TestUtil;
import java.io.IOException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit tests for {@link SsManifestParser}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class SsManifestParserTest {
private static final String SAMPLE_ISMC_1 = "media/smooth-streaming/sample_ismc_1";

View File

@ -31,9 +31,11 @@ import java.util.List;
import java.util.Random;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit tests for {@link SsManifest}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class SsManifestTest {
@Test

View File

@ -24,9 +24,11 @@ import com.google.android.exoplayer2.testutil.FakeDataSource;
import com.google.android.exoplayer2.util.MimeTypes;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit test to verify creation of a SmoothStreaming {@link DownloadHelper}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class DownloadHelperTest {
@Test

View File

@ -32,9 +32,11 @@ import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit tests for {@link SsDownloader}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class SsDownloaderTest {
@Test

View File

@ -31,9 +31,11 @@ import java.util.Arrays;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit tests for {@link SefSlowMotionVideoSampleTransformer}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class SefSlowMotionVideoSampleTransformerTest {
/**

View File

@ -29,9 +29,11 @@ import com.google.common.collect.ImmutableList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit tests for {@link SegmentSpeedProvider}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class SegmentSpeedProviderTest {
private static final SmtaMetadataEntry SMTA_SPEED_8 =

View File

@ -24,9 +24,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.util.MimeTypes;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit test for {@link Transformer.Builder}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class TransformerBuilderTest {
@Test

View File

@ -51,10 +51,12 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
import org.robolectric.shadows.ShadowMediaCodec;
/** Unit test for {@link Transformer}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class TransformerTest {
private static final String URI_PREFIX = "asset:///media/";

View File

@ -30,9 +30,11 @@ import com.google.common.base.Supplier;
import java.util.concurrent.TimeoutException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit test for {@link RobolectricUtil}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class RobolectricUtilTest {
@Test
public void createRobolectricConditionVariable_blockWithTimeout_timesOut()

View File

@ -29,9 +29,11 @@ import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runner.RunWith;
import org.junit.runners.model.Statement;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Tests for {@link AdditionalFailureInfo}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class AdditionalFailureInfoTest {
private final ExpectedException expectedException = new ExpectedException();

View File

@ -28,9 +28,11 @@ import java.util.List;
import java.util.Random;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit test for {@link FakeAdaptiveDataSet}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class FakeAdaptiveDataSetTest {
private static final Format[] TEST_FORMATS = {

View File

@ -32,10 +32,12 @@ import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
import org.robolectric.shadows.ShadowLooper;
/** Unit test for {@link FakeClock}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class FakeClockTest {
@Test

View File

@ -24,9 +24,11 @@ import java.io.IOException;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit test for {@link FakeDataSet} */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class FakeDataSetTest {
@Test

View File

@ -21,9 +21,11 @@ import com.google.android.exoplayer2.upstream.DataSource;
import com.google.common.collect.ImmutableList;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** {@link DataSource} contract tests for {@link FakeDataSource}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class FakeDataSourceContractTest extends DataSourceContractTest {
private Uri simpleUri;

View File

@ -27,9 +27,11 @@ import java.util.Arrays;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Unit test for {@link FakeDataSource}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class FakeDataSourceTest {
private static final String URI_STRING = "test://test.test";

View File

@ -28,6 +28,7 @@ import okhttp3.mockwebserver.MockWebServer;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Tests for {@link WebServerDispatcher}. */
// We use the OkHttp client library for these tests because it's generally nicer to use than Java's
@ -51,6 +52,7 @@ import org.junit.runner.RunWith;
// So instead we just don't test these cases that require passing header combinations that are
// impossible with OkHttp.
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class WebServerDispatcherTest {
private static int seed;

View File

@ -47,9 +47,11 @@ import com.google.android.exoplayer2.util.Util;
import com.google.common.truth.ExpectFailure;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;
/** Tests for {@link SpannedSubject}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public class SpannedSubjectTest {
private static final String TEXT_PREFIX = "string with ";