# androidx.media3.test.utils.robolectric

# androidx.media3.test.utils.robolectric

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/test/utils/robolectric/package-summary "View this page in Java")

## Interfaces

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CapturingRenderersFactory.TextRendererFactory](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/CapturingRenderersFactory.TextRendererFactory) | A factory for[Renderer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/Renderer)instances that handle[TRACK_TYPE_TEXT](https://developer.android.com/reference/kotlin/androidx/media3/common/C#TRACK_TYPE_TEXT())tracks.                                                                               |
| [PlayerAudioFocusContractTest.PlayerInfo](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/PlayerAudioFocusContractTest.PlayerInfo)             | Interface that allows access to a[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)instance and its internal[Clock](https://developer.android.com/reference/kotlin/androidx/media3/common/util/Clock)and processing[Looper](https://developer.android.com/reference/android/os/Looper.html). |
| [ScrubbingModeContractTest.PlayerInfo](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/ScrubbingModeContractTest.PlayerInfo)                   | Interface that allows access to a[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)instance, relevant internals, and other methods not implemented within the[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)interface required for testing.           |

## Classes

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CapturingRenderersFactory](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/CapturingRenderersFactory)                                                                   | A[RenderersFactory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/RenderersFactory)that captures interactions with the audio and video[MediaCodecAdapter](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter)instances and[ImageOutput](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageOutput)instances.                                |
| [CapturingRenderersFactory.CapturingMediaCodecVideoRenderer](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/CapturingRenderersFactory.CapturingMediaCodecVideoRenderer) | A[MediaCodecVideoRenderer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/video/MediaCodecVideoRenderer)that will not skip or drop buffers due to slow processing.                                                                                                                                                                                                                                                               |
| [FakeDownloader](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/FakeDownloader)                                                                                         | A fake[Downloader](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/Downloader).                                                                                                                                                                                                                                                                                                                                           |
| [IdlingMediaCodecAdapterFactory](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/IdlingMediaCodecAdapterFactory)                                                         | A[MediaCodecAdapter.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Factory)which can[idle](https://robolectric.org/javadoc/4.11/org/robolectric/shadows/ShadowLooper.html#idle--)all the async queueing and callback threads used in async MediaCodec mode.                                                                                                                                |
| [PlaybackOutput](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/PlaybackOutput)                                                                                         | Class to capture output from a playback test.                                                                                                                                                                                                                                                                                                                                                                                                              |
| [PlayerAudioFocusContractTest](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/PlayerAudioFocusContractTest)                                                             | A collection of contract tests for[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)implementations that support[COMMAND_SET_AUDIO_ATTRIBUTES](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#COMMAND_SET_AUDIO_ATTRIBUTES()).                                                                                                                                                           |
| [RandomizedMp3Decoder](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/RandomizedMp3Decoder)                                                                             | Generates randomized, but correct amount of data on MP3 audio input.                                                                                                                                                                                                                                                                                                                                                                                       |
| [RobolectricUtil](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/RobolectricUtil)                                                                                       | Utility methods for Robolectric-based tests.                                                                                                                                                                                                                                                                                                                                                                                                               |
| [ScrubbingModeContractTest](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/ScrubbingModeContractTest)                                                                   | A collection of contract tests for[Player](https://developer.android.com/reference/kotlin/androidx/media3/common/Player)implementations that support[COMMAND_SET_AUDIO_ATTRIBUTES](https://developer.android.com/reference/kotlin/androidx/media3/common/Player#COMMAND_SET_AUDIO_ATTRIBUTES())and[scrubbing mode](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer#setScrubbingModeEnabled(boolean)).                   |
| [ShadowMediaCodecConfig](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/ShadowMediaCodecConfig)                                                                         | A JUnit @Rule to configure Robolectric's[ShadowMediaCodec](https://robolectric.org/javadoc/4.11/org/robolectric/shadows/ShadowMediaCodec.html).                                                                                                                                                                                                                                                                                                            |
| [ShadowMediaCodecConfig.CodecInfo](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/ShadowMediaCodecConfig.CodecInfo)                                                     | Class that holds information about a[CodecImpl](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/ShadowMediaCodecConfig.CodecImpl)configuration.                                                                                                                                                                                                                                                                      |
| [TestDownloadManagerListener](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/TestDownloadManagerListener)                                                               | Allows tests to block for, and assert properties of, calls from a[DownloadManager](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager)to its[DownloadManager.Listener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/offline/DownloadManager.Listener).                                                                                                                           |
| [TestPlayerRunHelper](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/TestPlayerRunHelper)                                                                               | Helper methods to block the calling thread until the provided[ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)instance reaches a particular state.                                                                                                                                                                                                                                                           |
| [TestPlayerRunHelper.CompositionPlayerRunResult](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/TestPlayerRunHelper.CompositionPlayerRunResult)                         | A[CompositionPlayer](https://developer.android.com/reference/kotlin/androidx/media3/transformer/CompositionPlayer)specific subclass of[PlayerRunResult](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/TestPlayerRunHelper.PlayerRunResult), giving access to conditions that only make sense for[CompositionPlayer](https://developer.android.com/reference/kotlin/androidx/media3/transformer/CompositionPlayer). |
| [TestPlayerRunHelper.ExoPlayerRunResult](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/TestPlayerRunHelper.ExoPlayerRunResult)                                         | An[ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)specific subclass of[PlayerRunResult](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/TestPlayerRunHelper.PlayerRunResult), giving access to conditions that only make sense for the[ExoPlayer](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/ExoPlayer)interface.                       |
| [TestPlayerRunHelper.PlayerRunResult](https://developer.android.com/reference/kotlin/androidx/media3/test/utils/robolectric/TestPlayerRunHelper.PlayerRunResult)                                               | Intermediate type that allows callers to run the main[Looper](https://developer.android.com/reference/android/os/Looper.html)until certain conditions are met.                                                                                                                                                                                                                                                                                             |