Package com.google.android.exoplayer2.testutil

## Class MediaPeriodAsserts

- java.lang.Object
- - com.google.android.exoplayer2.testutil.MediaPeriodAsserts

-     public final class MediaPeriodAsserts
      extends Object

  Assertion methods for `MediaPeriod`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T extends FilterableManifest<T>>` | Interface to create media periods for testing based on a `FilterableManifest`.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static <T extends FilterableManifest<T>> void` | `assertGetStreamKeysAndManifestFilterIntegration​(MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T> mediaPeriodFactory, T manifest)` | Asserts that the values returns by `MediaPeriod.getStreamKeys(List)` are compatible with a `FilterableManifest` using these stream keys.
    `static <T extends FilterableManifest<T>> void` | `assertGetStreamKeysAndManifestFilterIntegration​(MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T> mediaPeriodFactory, T manifest, int periodIndex, String ignoredMimeType)` | Asserts that the values returns by `MediaPeriod.getStreamKeys(List)` are compatible with a `FilterableManifest` using these stream keys.
    `static void` | `assertTrackGroups​(MediaPeriod mediaPeriod, TrackGroupArray expectedGroups)` | Prepares the `MediaPeriod` and asserts that it provides the specified track groups.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### assertTrackGroups

          public static void assertTrackGroups​(MediaPeriod mediaPeriod,
                                               TrackGroupArray expectedGroups)

      Prepares the `MediaPeriod` and asserts that it provides the specified track groups.
      Parameters:
        `mediaPeriod` - The `MediaPeriod` to test.
        `expectedGroups` - The expected track groups.

    - #### assertGetStreamKeysAndManifestFilterIntegration

          public static <T extends FilterableManifest<T>> void assertGetStreamKeysAndManifestFilterIntegration​(MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T> mediaPeriodFactory,
                                                                                                               T manifest)

      Asserts that the values returns by `MediaPeriod.getStreamKeys(List)` are compatible with a `FilterableManifest` using these stream keys.
      Parameters:
        `mediaPeriodFactory` - A factory to create a `MediaPeriod` based on a manifest.
        `manifest` - The manifest which is to be tested.

    - #### assertGetStreamKeysAndManifestFilterIntegration

          public static <T extends FilterableManifest<T>> void assertGetStreamKeysAndManifestFilterIntegration​(MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T> mediaPeriodFactory,
                                                                                                               T manifest,
                                                                                                               int periodIndex,
                                                                                                               @Nullable
                                                                                                               String ignoredMimeType)

      Asserts that the values returns by `MediaPeriod.getStreamKeys(List)` are compatible with a `FilterableManifest` using these stream keys.
      Parameters:
        `mediaPeriodFactory` - A factory to create a `MediaPeriod` based on a manifest.
        `manifest` - The manifest which is to be tested.
        `periodIndex` - The index of period in the manifest.
        `ignoredMimeType` - Optional mime type whose existence in the filtered track groups is not asserted.