Commit d32181e4 by tonihei Committed by Oliver Woodman

Use more realistic timeline window duration for playback unit tests.

100ms is unrealistically short and, for example, causes the player to buffer
many periods ahead when looping.

Previously this was not feasible, because ExoPlayerTest as instrumentation test
actually needed to wait for the realtime playback duration.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183646772
parent 67a812c1
......@@ -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) {
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment