@UnstableApi
class TimelineAsserts


Assertion methods for Timeline.

Summary

Public functions

java-static Unit
assertAdGroupCounts(timeline: Timeline!, expectedAdGroupCounts: IntArray!)

Asserts that periods' getAdGroupCount are set correctly.

java-static Unit
assertEmpty(timeline: Timeline!)

Assert that timeline is empty (i.e. has no windows or periods).

java-static Unit
assertEqualNextWindowIndices(
    expectedTimeline: Timeline!,
    actualTimeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean
)

Asserts that next window indices for each window of the actual timeline are equal to the indices of the expected timeline depending on the repeat mode and the shuffle mode.

java-static Unit
assertEqualPreviousWindowIndices(
    expectedTimeline: Timeline!,
    actualTimeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean
)

Asserts that previous window indices for each window of the actual timeline are equal to the indices of the expected timeline depending on the repeat mode and the shuffle mode.

java-static Unit
assertEqualsExceptIdsAndManifest(
    expectedTimeline: Timeline!,
    actualTimeline: Timeline!
)

Asserts that timelines are equal except uid, manifest, id, and uid.

java-static Unit
assertNextWindowIndices(
    timeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean,
    expectedNextWindowIndices: IntArray!
)

Asserts that next window indices for each window depending on the repeat mode and the shuffle mode are equal to the given sequence.

java-static Unit
assertPeriodCounts(timeline: Timeline!, expectedPeriodCounts: IntArray!)

Asserts that period counts for each window are set correctly.

java-static Unit
assertPeriodDurations(timeline: Timeline!, durationsUs: LongArray!)

Asserts that the durations of the periods in the Timeline and the durations in the given sequence are equal.

java-static Unit
assertPeriodEqualsExceptIds(
    expectedPeriod: Timeline.Period!,
    actualPeriod: Timeline.Period!
)

Asserts that periods are equal except id and uid.

java-static Unit
assertPreviousWindowIndices(
    timeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean,
    expectedPreviousWindowIndices: IntArray!
)

Asserts that previous window indices for each window depending on the repeat mode and the shuffle mode are equal to the given sequence.

java-static Unit
assertWindowEqualsExceptUidAndManifest(
    expectedWindow: Timeline.Window!,
    actualWindow: Timeline.Window!
)

Asserts that windows are equal except uid and manifest.

java-static Unit
assertWindowIsDynamic(timeline: Timeline!, windowIsDynamic: BooleanArray!)

Asserts that window properties Window.isDynamic are set correctly.

java-static Unit
assertWindowTags(
    timeline: Timeline!,
    @NullableType expectedWindowTags: Array<Any!>!
)

Asserts that window tags are set correctly.

Public functions

assertAdGroupCounts

java-static fun assertAdGroupCounts(timeline: Timeline!, expectedAdGroupCounts: IntArray!): Unit

Asserts that periods' getAdGroupCount are set correctly.

assertEmpty

java-static fun assertEmpty(timeline: Timeline!): Unit

Assert that timeline is empty (i.e. has no windows or periods).

assertEqualNextWindowIndices

java-static fun assertEqualNextWindowIndices(
    expectedTimeline: Timeline!,
    actualTimeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean
): Unit

Asserts that next window indices for each window of the actual timeline are equal to the indices of the expected timeline depending on the repeat mode and the shuffle mode.

assertEqualPreviousWindowIndices

java-static fun assertEqualPreviousWindowIndices(
    expectedTimeline: Timeline!,
    actualTimeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean
): Unit

Asserts that previous window indices for each window of the actual timeline are equal to the indices of the expected timeline depending on the repeat mode and the shuffle mode.

assertEqualsExceptIdsAndManifest

java-static fun assertEqualsExceptIdsAndManifest(
    expectedTimeline: Timeline!,
    actualTimeline: Timeline!
): Unit

Asserts that timelines are equal except uid, manifest, id, and uid.

assertNextWindowIndices

java-static fun assertNextWindowIndices(
    timeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean,
    expectedNextWindowIndices: IntArray!
): Unit

Asserts that next window indices for each window depending on the repeat mode and the shuffle mode are equal to the given sequence.

assertPeriodCounts

java-static fun assertPeriodCounts(timeline: Timeline!, expectedPeriodCounts: IntArray!): Unit

Asserts that period counts for each window are set correctly. Also asserts that firstPeriodIndex and lastPeriodIndex are set correctly, and it asserts the correct behavior of getNextWindowIndex.

assertPeriodDurations

java-static fun assertPeriodDurations(timeline: Timeline!, durationsUs: LongArray!): Unit

Asserts that the durations of the periods in the Timeline and the durations in the given sequence are equal.

assertPeriodEqualsExceptIds

java-static fun assertPeriodEqualsExceptIds(
    expectedPeriod: Timeline.Period!,
    actualPeriod: Timeline.Period!
): Unit

Asserts that periods are equal except id and uid.

assertPreviousWindowIndices

java-static fun assertPreviousWindowIndices(
    timeline: Timeline!,
    @Player.RepeatMode repeatMode: Int,
    shuffleModeEnabled: Boolean,
    expectedPreviousWindowIndices: IntArray!
): Unit

Asserts that previous window indices for each window depending on the repeat mode and the shuffle mode are equal to the given sequence.

assertWindowEqualsExceptUidAndManifest

java-static fun assertWindowEqualsExceptUidAndManifest(
    expectedWindow: Timeline.Window!,
    actualWindow: Timeline.Window!
): Unit

Asserts that windows are equal except uid and manifest.

assertWindowIsDynamic

java-static fun assertWindowIsDynamic(timeline: Timeline!, windowIsDynamic: BooleanArray!): Unit

Asserts that window properties Window.isDynamic are set correctly.

assertWindowTags

java-static fun assertWindowTags(
    timeline: Timeline!,
    @NullableType expectedWindowTags: Array<Any!>!
): Unit

Asserts that window tags are set correctly.

Parameters
timeline: Timeline!

The timeline to read actual window tags from.

@NullableType expectedWindowTags: Array<Any!>!

A list of expected window tags. If a tag is unknown or not important null can be passed to skip this window.