TimelineAsserts
@UnstableApi
class TimelineAsserts
Assertion methods for Timeline.
Summary
Public functions |
|
|---|---|
java-static Unit |
assertAdGroupCounts(Asserts that periods' |
java-static Unit |
assertEmpty(timeline: Timeline!)Assert that timeline is empty (i.e. has no windows or periods). |
java-static Unit |
assertEqualNextWindowIndices(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(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(Asserts that |
java-static Unit |
assertNextWindowIndices(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(Asserts that period counts for each window are set correctly. |
java-static Unit |
assertPeriodDurations(timeline: Timeline!, durationsUs: LongArray<Long>!)Asserts that the durations of the periods in the |
java-static Unit |
assertPeriodEqualsExceptIds( |
java-static Unit |
assertPreviousWindowIndices(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( |
java-static Unit |
assertWindowIsDynamic(Asserts that window properties |
java-static Unit |
assertWindowTags(Asserts that window tags are set correctly. |
Public functions
assertAdGroupCounts
java-static fun assertAdGroupCounts(
timeline: Timeline!,
expectedAdGroupCounts: IntArray<Int>!
): 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<Int>!
): 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<Int>!
): 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<Long>!): 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
assertPreviousWindowIndices
java-static fun assertPreviousWindowIndices(
timeline: Timeline!,
@Player.RepeatMode repeatMode: Int,
shuffleModeEnabled: Boolean,
expectedPreviousWindowIndices: IntArray<Int>!
): 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
assertWindowIsDynamic
java-static fun assertWindowIsDynamic(
timeline: Timeline!,
windowIsDynamic: BooleanArray<Boolean>!
): 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 |