Commit bb33d568 by tonihei Committed by Oliver Woodman

Remove test-specific ActionSchedule tags

There is no need for that, updating them is often forgotten and
takes up too much line space. Replace by a single TAG per test class.

PiperOrigin-RevId: 300113072
parent 0d230d51
...@@ -69,6 +69,8 @@ import org.robolectric.annotation.LooperMode.Mode; ...@@ -69,6 +69,8 @@ import org.robolectric.annotation.LooperMode.Mode;
@LooperMode(Mode.PAUSED) @LooperMode(Mode.PAUSED)
public final class AnalyticsCollectorTest { public final class AnalyticsCollectorTest {
private static final String TAG = "AnalyticsCollectorTest";
private static final int EVENT_PLAYER_STATE_CHANGED = 0; private static final int EVENT_PLAYER_STATE_CHANGED = 0;
private static final int EVENT_TIMELINE_CHANGED = 1; private static final int EVENT_TIMELINE_CHANGED = 1;
private static final int EVENT_POSITION_DISCONTINUITY = 2; private static final int EVENT_POSITION_DISCONTINUITY = 2;
...@@ -309,7 +311,7 @@ public final class AnalyticsCollectorTest { ...@@ -309,7 +311,7 @@ public final class AnalyticsCollectorTest {
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT), new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT),
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.AUDIO_FORMAT)); new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.AUDIO_FORMAT));
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.seek(/* windowIndex= */ 1, /* positionMs= */ 0) .seek(/* windowIndex= */ 1, /* positionMs= */ 0)
...@@ -379,7 +381,7 @@ public final class AnalyticsCollectorTest { ...@@ -379,7 +381,7 @@ public final class AnalyticsCollectorTest {
long periodDurationMs = long periodDurationMs =
SINGLE_PERIOD_TIMELINE.getWindow(/* windowIndex= */ 0, new Window()).getDurationMs(); SINGLE_PERIOD_TIMELINE.getWindow(/* windowIndex= */ 0, new Window()).getDurationMs();
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.playUntilPosition(/* windowIndex= */ 0, periodDurationMs) .playUntilPosition(/* windowIndex= */ 0, periodDurationMs)
...@@ -460,7 +462,7 @@ public final class AnalyticsCollectorTest { ...@@ -460,7 +462,7 @@ public final class AnalyticsCollectorTest {
MediaSource mediaSource2 = MediaSource mediaSource2 =
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT); new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.setMediaSources(/* resetPosition= */ false, mediaSource2) .setMediaSources(/* resetPosition= */ false, mediaSource2)
...@@ -536,7 +538,7 @@ public final class AnalyticsCollectorTest { ...@@ -536,7 +538,7 @@ public final class AnalyticsCollectorTest {
MediaSource mediaSource = MediaSource mediaSource =
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT); new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.throwPlaybackException(ExoPlaybackException.createForSource(new IOException())) .throwPlaybackException(ExoPlaybackException.createForSource(new IOException()))
...@@ -611,7 +613,7 @@ public final class AnalyticsCollectorTest { ...@@ -611,7 +613,7 @@ public final class AnalyticsCollectorTest {
long periodDurationMs = long periodDurationMs =
SINGLE_PERIOD_TIMELINE.getWindow(/* windowIndex= */ 0, new Window()).getDurationMs(); SINGLE_PERIOD_TIMELINE.getWindow(/* windowIndex= */ 0, new Window()).getDurationMs();
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
// Ensure second period is already being read from. // Ensure second period is already being read from.
...@@ -687,7 +689,7 @@ public final class AnalyticsCollectorTest { ...@@ -687,7 +689,7 @@ public final class AnalyticsCollectorTest {
MediaSource fakeMediaSource = MediaSource fakeMediaSource =
new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT); new FakeMediaSource(SINGLE_PERIOD_TIMELINE, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.addMediaSources(fakeMediaSource) .addMediaSources(fakeMediaSource)
...@@ -778,7 +780,7 @@ public final class AnalyticsCollectorTest { ...@@ -778,7 +780,7 @@ public final class AnalyticsCollectorTest {
FakeMediaSource fakeMediaSource = FakeMediaSource fakeMediaSource =
new FakeMediaSource(adTimeline, ExoPlayerTestRunner.Builder.VIDEO_FORMAT); new FakeMediaSource(adTimeline, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.executeRunnable( .executeRunnable(
new PlayerRunnable() { new PlayerRunnable() {
@Override @Override
...@@ -1004,7 +1006,7 @@ public final class AnalyticsCollectorTest { ...@@ -1004,7 +1006,7 @@ public final class AnalyticsCollectorTest {
FakeMediaSource fakeMediaSource = FakeMediaSource fakeMediaSource =
new FakeMediaSource(adTimeline, ExoPlayerTestRunner.Builder.VIDEO_FORMAT); new FakeMediaSource(adTimeline, ExoPlayerTestRunner.Builder.VIDEO_FORMAT);
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
// Ensure everything is preloaded. // Ensure everything is preloaded.
.waitForIsLoading(true) .waitForIsLoading(true)
...@@ -1112,7 +1114,7 @@ public final class AnalyticsCollectorTest { ...@@ -1112,7 +1114,7 @@ public final class AnalyticsCollectorTest {
public void notifyExternalEvents() throws Exception { public void notifyExternalEvents() throws Exception {
MediaSource mediaSource = new FakeMediaSource(SINGLE_PERIOD_TIMELINE); MediaSource mediaSource = new FakeMediaSource(SINGLE_PERIOD_TIMELINE);
ActionSchedule actionSchedule = ActionSchedule actionSchedule =
new ActionSchedule.Builder("AnalyticsCollectorTest") new ActionSchedule.Builder(TAG)
.pause() .pause()
.waitForPlaybackState(Player.STATE_READY) .waitForPlaybackState(Player.STATE_READY)
.executeRunnable( .executeRunnable(
......
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