# Package com.google.android.exoplayer2.testutil

- Interface Summary
  Interface | Description
  --- | ---
  ActionSchedule.Callback | Callback to notify listener that the action schedule has finished.
  ActionSchedule.PlayerTarget.Callback | Callback to be called when message arrives.
  DummyMainThread.TestRunnable | `Runnable` variant which can throw a checked exception.
  Dumper.Dumpable | Provides custom dump method.
  ExtractorAsserts.ExtractorFactory | A factory for `Extractor` instances.
  FakeMediaPeriod.TrackDataFactory | A factory to create the test data for a particular track.
  FakeTrackOutput.Factory | Factory for `FakeTrackOutput` instances.
  HostActivity.HostedTest | Interface for tests that run inside of a `HostActivity`.
  MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T extends FilterableManifest<T>> | Interface to create media periods for testing based on a `FilterableManifest`.

- Class Summary
  Class | Description
  --- | ---
  Action | Base class for actions to perform during playback tests.
  Action.AddMediaItems | Calls `SimpleExoPlayer.addMediaSources(List)`.
  Action.ClearMediaItems | Calls `BasePlayer.clearMediaItems()`}.
  Action.ClearVideoSurface | Calls `SimpleExoPlayer.clearVideoSurface()`.
  Action.ExecuteRunnable | Calls `Runnable.run()`.
  Action.MoveMediaItem | Calls `BasePlayer.moveMediaItem(int, int)`.
  Action.PlayUntilPosition | Schedules a play action to be executed, waits until the player reaches the specified position, and pauses the player again.
  Action.Prepare | Calls `Player.prepare()`.
  Action.RemoveMediaItem | Calls `BasePlayer.removeMediaItem(int)`.
  Action.RemoveMediaItems | Calls `SimpleExoPlayer.removeMediaItems(int, int)`.
  Action.Seek | Calls `Player.seekTo(long)` or `Player.seekTo(int, long)`.
  Action.SendMessages | Calls `ExoPlayer.createMessage(Target)` and `PlayerMessage.send()`.
  Action.SetAudioAttributes | Calls `SimpleExoPlayer.setAudioAttributes(AudioAttributes, boolean)`.
  Action.SetMediaItems | Calls `SimpleExoPlayer.setMediaSources(List, int, long)`.
  Action.SetMediaItemsResetPosition | Calls `SimpleExoPlayer.setMediaSources(List, boolean)`.
  Action.SetPlaybackParameters | Calls `Player.setPlaybackParameters(PlaybackParameters)`.
  Action.SetPlayWhenReady | Calls `Player.setPlayWhenReady(boolean)`.
  Action.SetRendererDisabled | Updates the `DefaultTrackSelector.Parameters` of a `DefaultTrackSelector` to specify whether the renderer at a given index should be disabled.
  Action.SetRepeatMode | Calls `Player.setRepeatMode(int)`.
  Action.SetShuffleModeEnabled | Calls `Player.setShuffleModeEnabled(boolean)`.
  Action.SetShuffleOrder | Calls `ExoPlayer.setShuffleOrder(ShuffleOrder)` .
  Action.SetVideoSurface | Calls `SimpleExoPlayer.setVideoSurface(Surface)`.
  Action.Stop | Calls `Player.stop()` or `Player.stop(boolean)`.
  Action.ThrowPlaybackException | Throws a playback exception on the playback thread.
  Action.WaitForIsLoading | Waits for a specified loading state, returning either immediately or after a call to `Player.Listener.onIsLoadingChanged(boolean)`.
  Action.WaitForMessage | Waits for a player message to arrive.
  Action.WaitForPendingPlayerCommands | Waits until the player acknowledged all pending player commands.
  Action.WaitForPlaybackState | Waits for a specified playback state, returning either immediately or after a call to `Player.Listener.onPlaybackStateChanged(int)`.
  Action.WaitForPlayWhenReady | Waits for a specified playWhenReady value, returning either immediately or after a call to `Player.Listener.onPlayWhenReadyChanged(boolean, int)`.
  Action.WaitForPositionDiscontinuity | Waits for `Player.Listener.onPositionDiscontinuity(Player.PositionInfo, Player.PositionInfo, int)`.
  Action.WaitForTimelineChanged | Waits for `Player.Listener.onTimelineChanged(Timeline, int)`.
  ActionSchedule | Schedules a sequence of `Action`s for execution during a test.
  ActionSchedule.Builder | A builder for `ActionSchedule` instances.
  ActionSchedule.PlayerRunnable | Provides a wrapper for a `Runnable` which has access to the player.
  ActionSchedule.PlayerTarget | Provides a wrapper for a `PlayerMessage.Target` which has access to the player when handling messages.
  AdditionalFailureInfo | A JUnit `Rule` that attaches additional info to any errors/exceptions thrown by the test.
  CacheAsserts | Assertion methods for `Cache`.
  CacheAsserts.RequestSet | Defines a set of data requests.
  CapturingAudioSink | A `ForwardingAudioSink` that captures configuration, discontinuity and buffer events.
  CapturingRenderersFactory | A `RenderersFactory` that captures interactions with the audio and video `MediaCodecAdapter` instances.
  DataSourceContractTest | A collection of contract tests for `DataSource` implementations.
  DataSourceContractTest.FakeTransferListener | A `TransferListener` that only keeps track of the transferred bytes.
  DataSourceContractTest.TestResource | Information about a resource that can be used to test the `DataSource` instance.
  DataSourceContractTest.TestResource.Builder | Builder for `DataSourceContractTest.TestResource` instances.
  DecoderCountersUtil | Assertions for `DecoderCounters`.
  DefaultRenderersFactoryAsserts | Assertions for `DefaultRenderersFactory`.
  DownloadBuilder | Builder for `Download`.
  DummyMainThread | Helper class to simulate main/UI thread in tests.
  DumpableFormat | Wraps a `Format` to allow dumping it.
  Dumper | Helper utility to dump field values.
  DumpFileAsserts | Helper class to enable assertions based on golden-data dump files.
  ExoHostedTest | A `HostActivity.HostedTest` for `ExoPlayer` playback tests.
  ExoPlayerTestRunner | Helper class to run an ExoPlayer test.
  ExoPlayerTestRunner.Builder | Builder to set-up a `ExoPlayerTestRunner`.
  ExtractorAsserts | Assertion methods for `Extractor`.
  ExtractorAsserts.AssertionConfig | A config for the assertions made (e.g.
  ExtractorAsserts.AssertionConfig.Builder | Builder for `ExtractorAsserts.AssertionConfig` instances.
  ExtractorAsserts.SimulationConfig | A config of different environments to simulate and extractor behaviours to test.
  FailOnCloseDataSink | A `DataSink` that can simulate caching the bytes being written to it, and then failing to persist them when `FailOnCloseDataSink.close()` is called.
  FailOnCloseDataSink.Factory | Factory to create a `FailOnCloseDataSink`.
  FakeAdaptiveDataSet | Fake data set emulating the data of an adaptive media source.
  FakeAdaptiveDataSet.Factory | Factory for `FakeAdaptiveDataSet`s.
  FakeAdaptiveDataSet.Iterator | `MediaChunkIterator` for the chunks defined by a fake adaptive data set.
  FakeAdaptiveMediaPeriod | Fake `MediaPeriod` that provides tracks from the given `TrackGroupArray`.
  FakeAdaptiveMediaSource | Fake `MediaSource` that provides a given timeline.
  FakeAudioRenderer | A `FakeRenderer` that supports `C.TRACK_TYPE_AUDIO`.
  FakeChunkSource | Fake `ChunkSource` with adaptive media chunks of a given duration.
  FakeChunkSource.Factory | Factory for a `FakeChunkSource`.
  FakeClock | Fake `Clock` implementation that allows to `advance the time` manually to trigger pending timed messages.
  FakeDataSet | Collection of `FakeDataSet.FakeData` to be served by a `FakeDataSource`.
  FakeDataSet.FakeData | Container of fake data to be served by a `FakeDataSource`.
  FakeDataSet.FakeData.Segment | A segment of `FakeDataSet.FakeData`.
  FakeDataSource | A fake `DataSource` capable of simulating various scenarios.
  FakeDataSource.Factory | Factory to create a `FakeDataSource`.
  FakeExoMediaDrm | A fake implementation of `ExoMediaDrm` for use in tests.
  FakeExoMediaDrm.Builder | Builder for `FakeExoMediaDrm` instances.
  FakeExoMediaDrm.LicenseServer | An license server implementation to interact with `FakeExoMediaDrm`.
  FakeExtractorInput | A fake `ExtractorInput` capable of simulating various scenarios.
  FakeExtractorInput.Builder | Builder of `FakeExtractorInput` instances.
  FakeExtractorOutput | A fake `ExtractorOutput`.
  FakeMediaChunk | Fake `MediaChunk`.
  FakeMediaChunkIterator | Fake `MediaChunkIterator`.
  FakeMediaClockRenderer | Fake abstract `Renderer` which is also a `MediaClock`.
  FakeMediaPeriod | Fake `MediaPeriod` that provides tracks from the given `TrackGroupArray`.
  FakeMediaSource | Fake `MediaSource` that provides a given timeline.
  FakeMediaSource.InitialTimeline | A forwarding timeline to provide an initial timeline for fake multi window sources.
  FakeRenderer | Fake `Renderer` that supports any format with the matching track type.
  FakeSampleStream | Fake `SampleStream` that outputs a given `Format` and any amount of `items`.
  FakeSampleStream.FakeSampleStreamItem | Item to customize a return value of `SampleStream.readData(com.google.android.exoplayer2.FormatHolder, com.google.android.exoplayer2.decoder.DecoderInputBuffer, int)`.
  FakeShuffleOrder | Fake `ShuffleOrder` which returns a reverse order.
  FakeTimeline | Fake `Timeline` which can be setup to return custom `FakeTimeline.TimelineWindowDefinition`s.
  FakeTimeline.TimelineWindowDefinition | Definition used to define a `FakeTimeline`.
  FakeTrackOutput | A fake `TrackOutput`.
  FakeTrackSelection | A fake `ExoTrackSelection` that only returns 1 fixed track, and allows querying the number of calls to its methods.
  FakeTrackSelector | A fake `MappingTrackSelector` that returns `FakeTrackSelection`s.
  FakeVideoRenderer | A `FakeRenderer` that supports `C.TRACK_TYPE_VIDEO`.
  HostActivity | A host activity for performing playback tests.
  HttpDataSourceTestEnv | A JUnit `Rule` that creates test resources for `HttpDataSource` contract tests.
  MediaPeriodAsserts | Assertion methods for `MediaPeriod`.
  MediaSourceTestRunner | A runner for `MediaSource` tests.
  NoUidTimeline | A timeline which wraps another timeline and overrides all window and period uids to 0.
  StubExoPlayer | An abstract `ExoPlayer` implementation that throws `UnsupportedOperationException` from every method.
  TestExoPlayerBuilder | A builder of `SimpleExoPlayer` instances for testing.
  TestUtil | Utility methods for tests.
  TimelineAsserts | Assertion methods for `Timeline`.
  WebServerDispatcher | A `Dispatcher` for `MockWebServer` that allows per-path customisation of the static data served.
  WebServerDispatcher.Resource | A resource served by `WebServerDispatcher`.
  WebServerDispatcher.Resource.Builder | Builder for `WebServerDispatcher.Resource`.

- Exception Summary
  Exception | Description
  --- | ---
  FakeExtractorInput.SimulatedIOException | Thrown when simulating an `IOException`.