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
This commit is contained in:
olly 2021-01-21 09:15:27 +00:00 committed by kim-vde
parent 737630740c
commit b460124c33

View file

@ -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();