Class TimelineAsserts


  • public final class TimelineAsserts
    extends Object
    Assertion methods for Timeline.
    • Method Detail

      • assertEmpty

        public static void assertEmpty​(Timeline timeline)
        Assert that timeline is empty (i.e. has no windows or periods).
      • assertWindowTags

        public static void assertWindowTags​(Timeline timeline,
                                            @NullableType Object... expectedWindowTags)
        Asserts that window tags are set correctly.
        Parameters:
        timeline - The timeline to read actual window tags from.
        expectedWindowTags - A list of expected window tags. If a tag is unknown or not important null can be passed to skip this window.
      • assertWindowIsDynamic

        public static void assertWindowIsDynamic​(Timeline timeline,
                                                 boolean... windowIsDynamic)
        Asserts that window properties Timeline.Window.isDynamic are set correctly.
      • assertPreviousWindowIndices

        public static void assertPreviousWindowIndices​(Timeline timeline,
                                                       @RepeatMode
                                                       @com.google.android.exoplayer2.Player.RepeatMode int repeatMode,
                                                       boolean shuffleModeEnabled,
                                                       int... expectedPreviousWindowIndices)
        Asserts that previous window indices for each window depending on the repeat mode and the shuffle mode are equal to the given sequence.
      • assertNextWindowIndices

        public static void assertNextWindowIndices​(Timeline timeline,
                                                   @RepeatMode
                                                   @com.google.android.exoplayer2.Player.RepeatMode int repeatMode,
                                                   boolean shuffleModeEnabled,
                                                   int... expectedNextWindowIndices)
        Asserts that next window indices for each window depending on the repeat mode and the shuffle mode are equal to the given sequence.
      • assertEqualPreviousWindowIndices

        public static void assertEqualPreviousWindowIndices​(Timeline expectedTimeline,
                                                            Timeline actualTimeline,
                                                            @RepeatMode
                                                            @com.google.android.exoplayer2.Player.RepeatMode int repeatMode,
                                                            boolean shuffleModeEnabled)
        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.
      • assertEqualNextWindowIndices

        public static void assertEqualNextWindowIndices​(Timeline expectedTimeline,
                                                        Timeline actualTimeline,
                                                        @RepeatMode
                                                        @com.google.android.exoplayer2.Player.RepeatMode int repeatMode,
                                                        boolean shuffleModeEnabled)
        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.
      • assertPeriodDurations

        public static void assertPeriodDurations​(Timeline timeline,
                                                 long... durationsUs)
        Asserts that the durations of the periods in the Timeline and the durations in the given sequence are equal.