diff --git a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java index 0146f036f2..3855d5ed2a 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java @@ -165,7 +165,11 @@ public final class ExoPlayerTest { */ @Test public void testReadAheadToEndDoesNotResetRenderer() throws Exception { - Timeline timeline = new FakeTimeline(/* windowCount= */ 3); + // Use sufficiently short periods to ensure the player attempts to read all at once. + TimelineWindowDefinition windowDefinition = + new TimelineWindowDefinition( + /* isSeekable= */ false, /* isDynamic= */ false, /* durationUs= */ 100_000); + Timeline timeline = new FakeTimeline(windowDefinition, windowDefinition, windowDefinition); final FakeRenderer videoRenderer = new FakeRenderer(Builder.VIDEO_FORMAT); FakeMediaClockRenderer audioRenderer = new FakeMediaClockRenderer(Builder.AUDIO_FORMAT) { diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTimeline.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTimeline.java index 797c09d6b6..0557a138e1 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTimeline.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeTimeline.java @@ -31,10 +31,8 @@ public final class FakeTimeline extends Timeline { */ public static final class TimelineWindowDefinition { - /** - * Default test window duration in microseconds. - */ - public static final int DEFAULT_WINDOW_DURATION_US = 100_000; + /** Default test window duration in microseconds. */ + public static final long DEFAULT_WINDOW_DURATION_US = 10 * C.MICROS_PER_SECOND; public final int periodCount; public final Object id;