From b460124c33b745fa8461caaddfa3ce86a10a7eb4 Mon Sep 17 00:00:00 2001 From: olly Date: Thu, 21 Jan 2021 09:15:27 +0000 Subject: [PATCH] Setup ShadowMediaCodecConfig for SilencePlaybackTest Codecs are not used by this test because PCM uses codec bypass, but performing the setup is still necessary to have the test verify that this is indeed the case! PiperOrigin-RevId: 352965739 --- .../android/exoplayer2/e2etest/SilencePlaybackTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/core/src/test/java/com/google/android/exoplayer2/e2etest/SilencePlaybackTest.java b/library/core/src/test/java/com/google/android/exoplayer2/e2etest/SilencePlaybackTest.java index c1905da7c7..886b45aed6 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/e2etest/SilencePlaybackTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/e2etest/SilencePlaybackTest.java @@ -21,11 +21,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4; import com.google.android.exoplayer2.Player; import com.google.android.exoplayer2.SimpleExoPlayer; import com.google.android.exoplayer2.robolectric.PlaybackOutput; +import com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig; import com.google.android.exoplayer2.robolectric.TestPlayerRunHelper; import com.google.android.exoplayer2.source.SilenceMediaSource; import com.google.android.exoplayer2.testutil.AutoAdvancingFakeClock; import com.google.android.exoplayer2.testutil.CapturingRenderersFactory; import com.google.android.exoplayer2.testutil.DumpFileAsserts; +import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.annotation.Config; @@ -36,6 +38,10 @@ import org.robolectric.annotation.Config; @RunWith(AndroidJUnit4.class) public final class SilencePlaybackTest { + @Rule + public ShadowMediaCodecConfig mediaCodecConfig = + ShadowMediaCodecConfig.forAllSupportedMimeTypes(); + @Test public void test_500ms() throws Exception { Context applicationContext = ApplicationProvider.getApplicationContext();