From 85b6a5166696a969b91ac71aee784c99cfcc24e3 Mon Sep 17 00:00:00 2001 From: olly Date: Wed, 2 Jun 2021 14:53:05 +0100 Subject: [PATCH] Add DoNotInstrument annotations to DASH and UI tests PiperOrigin-RevId: 377048460 --- .../com/google/android/exoplayer2/e2etest/DashPlaybackTest.java | 2 ++ .../android/exoplayer2/source/dash/DashMediaPeriodTest.java | 2 ++ .../android/exoplayer2/source/dash/DashMediaSourceTest.java | 2 ++ .../com/google/android/exoplayer2/source/dash/DashUtilTest.java | 2 ++ .../exoplayer2/source/dash/DefaultDashChunkSourceTest.java | 2 ++ .../exoplayer2/source/dash/DefaultMediaSourceFactoryTest.java | 2 ++ .../android/exoplayer2/source/dash/EventSampleStreamTest.java | 2 ++ .../exoplayer2/source/dash/manifest/DashManifestParserTest.java | 2 ++ .../exoplayer2/source/dash/manifest/DashManifestTest.java | 2 ++ .../android/exoplayer2/source/dash/manifest/RangedUriTest.java | 2 ++ .../exoplayer2/source/dash/manifest/SegmentBaseTest.java | 2 ++ .../exoplayer2/source/dash/manifest/UrlTemplateTest.java | 2 ++ .../exoplayer2/source/dash/offline/DashDownloaderTest.java | 2 ++ .../exoplayer2/source/dash/offline/DownloadHelperTest.java | 2 ++ .../exoplayer2/source/dash/offline/DownloadManagerDashTest.java | 2 ++ .../exoplayer2/source/dash/offline/DownloadServiceDashTest.java | 2 ++ .../java/com/google/android/exoplayer2/ui/HtmlUtilsTest.java | 2 ++ .../android/exoplayer2/ui/SpannedToHtmlConverterTest.java | 2 ++ .../com/google/android/exoplayer2/ui/SubtitleViewUtilsTest.java | 2 ++ 19 files changed, 38 insertions(+) diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/e2etest/DashPlaybackTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/e2etest/DashPlaybackTest.java index 372fa07646..cc80298443 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/e2etest/DashPlaybackTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/e2etest/DashPlaybackTest.java @@ -36,11 +36,13 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.annotation.Config; +import org.robolectric.annotation.internal.DoNotInstrument; /** End-to-end tests using DASH samples. */ // TODO(b/143232359): Remove once https://issuetracker.google.com/143232359 is resolved. @Config(sdk = 29) @RunWith(AndroidJUnit4.class) +@DoNotInstrument public final class DashPlaybackTest { @Rule diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaPeriodTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaPeriodTest.java index 99fd169437..2391825237 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaPeriodTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaPeriodTest.java @@ -44,9 +44,11 @@ import java.io.InputStream; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit tests for {@link DashMediaPeriod}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public final class DashMediaPeriodTest { @Test diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaSourceTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaSourceTest.java index 04bd655b07..d19347cdde 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaSourceTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashMediaSourceTest.java @@ -45,11 +45,13 @@ import java.util.concurrent.atomic.AtomicReference; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.annotation.LooperMode; +import org.robolectric.annotation.internal.DoNotInstrument; import org.robolectric.shadows.ShadowLooper; /** Unit test for {@link DashMediaSource}. */ @RunWith(AndroidJUnit4.class) @LooperMode(PAUSED) +@DoNotInstrument public final class DashMediaSourceTest { private static final String SAMPLE_MPD_LIVE_WITHOUT_LIVE_CONFIGURATION = diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashUtilTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashUtilTest.java index 188d1b2a18..7a30062ad0 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashUtilTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DashUtilTest.java @@ -32,9 +32,11 @@ import java.util.Arrays; import java.util.Collections; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit tests for {@link DashUtil}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public final class DashUtilTest { @Test diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSourceTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSourceTest.java index e403482b6c..fa5ee71e84 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSourceTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultDashChunkSourceTest.java @@ -36,9 +36,11 @@ import com.google.android.exoplayer2.upstream.LoaderErrorThrower; import com.google.common.collect.ImmutableList; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit test for {@link DefaultDashChunkSource}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class DefaultDashChunkSourceTest { private static final String SAMPLE_MPD_LIVE_WITH_OFFSET_INSIDE_WINDOW = diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultMediaSourceFactoryTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultMediaSourceFactoryTest.java index ab7f456c55..1e64b8d7a4 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultMediaSourceFactoryTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/DefaultMediaSourceFactoryTest.java @@ -27,9 +27,11 @@ 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 DASH media sources with the {@link DefaultMediaSourceFactory}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class DefaultMediaSourceFactoryTest { private static final String URI_MEDIA = "http://exoplayer.dev/video"; diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/EventSampleStreamTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/EventSampleStreamTest.java index 2ebca95996..a91cd65baa 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/EventSampleStreamTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/EventSampleStreamTest.java @@ -30,9 +30,11 @@ import com.google.android.exoplayer2.util.MimeTypes; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit test for {@link EventSampleStream}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public final class EventSampleStreamTest { private static final String SCHEME_ID = "urn:test"; diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java index 24ae834f33..9dc7c9ea5a 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParserTest.java @@ -35,11 +35,13 @@ import java.util.Collections; import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; /** Unit tests for {@link DashManifestParser}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class DashManifestParserTest { private static final String SAMPLE_MPD_LIVE = "media/mpd/sample_mpd_live"; diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestTest.java index 7b3b3cab51..74c1db4da5 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestTest.java @@ -29,9 +29,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 DashManifest}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class DashManifestTest { private static final UtcTimingElement UTC_TIMING = new UtcTimingElement("", ""); diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/RangedUriTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/RangedUriTest.java index 44af227d96..486ab08cd1 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/RangedUriTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/RangedUriTest.java @@ -21,9 +21,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.exoplayer2.C; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit test for {@link RangedUri}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class RangedUriTest { private static final String BASE_URI = "http://www.test.com/"; diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBaseTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBaseTest.java index 91ddfbbde9..49346c4f98 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBaseTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBaseTest.java @@ -21,9 +21,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.exoplayer2.C; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit test for {@link SegmentBase}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public final class SegmentBaseTest { @Test diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/UrlTemplateTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/UrlTemplateTest.java index 6736840d82..057844d848 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/UrlTemplateTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/manifest/UrlTemplateTest.java @@ -21,9 +21,11 @@ import static org.junit.Assert.fail; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit test for {@link UrlTemplate}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class UrlTemplateTest { @Test diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DashDownloaderTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DashDownloaderTest.java index d835b85725..e47137baf9 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DashDownloaderTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DashDownloaderTest.java @@ -57,9 +57,11 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit tests for {@link DashDownloader}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class DashDownloaderTest { private SimpleCache cache; diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadHelperTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadHelperTest.java index bfc11cb47a..b7323c49a3 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadHelperTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadHelperTest.java @@ -25,9 +25,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 DASH {@link DownloadHelper}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public final class DownloadHelperTest { @Test diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java index 6bdc84438b..29102dfe3e 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadManagerDashTest.java @@ -55,10 +55,12 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; +import org.robolectric.annotation.internal.DoNotInstrument; import org.robolectric.shadows.ShadowLog; /** Tests {@link DownloadManager}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class DownloadManagerDashTest { private static final int ASSERT_TRUE_TIMEOUT_MS = 5000; diff --git a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadServiceDashTest.java b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadServiceDashTest.java index 98a7f6e887..e62a644af5 100644 --- a/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadServiceDashTest.java +++ b/library/dash/src/test/java/com/google/android/exoplayer2/source/dash/offline/DownloadServiceDashTest.java @@ -57,9 +57,11 @@ import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Unit tests for {@link DownloadService}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class DownloadServiceDashTest { private SimpleCache cache; diff --git a/library/ui/src/test/java/com/google/android/exoplayer2/ui/HtmlUtilsTest.java b/library/ui/src/test/java/com/google/android/exoplayer2/ui/HtmlUtilsTest.java index 82ddfb4202..68469e8886 100644 --- a/library/ui/src/test/java/com/google/android/exoplayer2/ui/HtmlUtilsTest.java +++ b/library/ui/src/test/java/com/google/android/exoplayer2/ui/HtmlUtilsTest.java @@ -21,9 +21,11 @@ import android.graphics.Color; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Tests for {@link HtmlUtils}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class HtmlUtilsTest { @Test diff --git a/library/ui/src/test/java/com/google/android/exoplayer2/ui/SpannedToHtmlConverterTest.java b/library/ui/src/test/java/com/google/android/exoplayer2/ui/SpannedToHtmlConverterTest.java index 09efaad709..187dcf6204 100644 --- a/library/ui/src/test/java/com/google/android/exoplayer2/ui/SpannedToHtmlConverterTest.java +++ b/library/ui/src/test/java/com/google/android/exoplayer2/ui/SpannedToHtmlConverterTest.java @@ -39,9 +39,11 @@ import com.google.android.exoplayer2.text.span.TextEmphasisSpan; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.annotation.Config; +import org.robolectric.annotation.internal.DoNotInstrument; /** Tests for {@link SpannedToHtmlConverter}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class SpannedToHtmlConverterTest { private final float displayDensity; diff --git a/library/ui/src/test/java/com/google/android/exoplayer2/ui/SubtitleViewUtilsTest.java b/library/ui/src/test/java/com/google/android/exoplayer2/ui/SubtitleViewUtilsTest.java index 1ad530cc11..1b211626c3 100644 --- a/library/ui/src/test/java/com/google/android/exoplayer2/ui/SubtitleViewUtilsTest.java +++ b/library/ui/src/test/java/com/google/android/exoplayer2/ui/SubtitleViewUtilsTest.java @@ -34,9 +34,11 @@ import com.google.android.exoplayer2.text.span.TextAnnotation; import com.google.android.exoplayer2.text.span.TextEmphasisSpan; import org.junit.Test; import org.junit.runner.RunWith; +import org.robolectric.annotation.internal.DoNotInstrument; /** Tests for {@link SubtitleView}. */ @RunWith(AndroidJUnit4.class) +@DoNotInstrument public class SubtitleViewUtilsTest { private static final Cue CUE = buildCue();