MediaPeriodAsserts


@UnstableApi
public final class MediaPeriodAsserts


Assertion methods for MediaPeriod.

Summary

Nested types

Interface to create media periods for testing based on a FilterableManifest.

Public methods

static void

Asserts that the values returns by getStreamKeys are compatible with a FilterableManifest using these stream keys.

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

Asserts that the values returns by getStreamKeys 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.

Public methods

assertGetStreamKeysAndManifestFilterIntegration

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

Asserts that the values returns by getStreamKeys are compatible with a FilterableManifest using these stream keys.

Parameters
MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T> mediaPeriodFactory

A factory to create a MediaPeriod based on a manifest.

T manifest

The manifest which is to be tested.

assertGetStreamKeysAndManifestFilterIntegration

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

Asserts that the values returns by getStreamKeys are compatible with a FilterableManifest using these stream keys.

Parameters
MediaPeriodAsserts.FilterableManifestMediaPeriodFactory<T> mediaPeriodFactory

A factory to create a MediaPeriod based on a manifest.

T manifest

The manifest which is to be tested.

int periodIndex

The index of period in the manifest.

@Nullable String ignoredMimeType

Optional MIME type whose existence in the filtered track groups is not asserted.

assertTrackGroups

public static void assertTrackGroups(
    MediaPeriod mediaPeriod,
    TrackGroupArray expectedGroups
)

Prepares the MediaPeriod and asserts that it provides the specified track groups.

Parameters
MediaPeriod mediaPeriod

The MediaPeriod to test.

TrackGroupArray expectedGroups

The expected track groups.