mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove ExoPlayerTest.PlayerStateGrabber
It's no longer needed
PiperOrigin-RevId: 454161070
(cherry picked from commit 8c63ba6fdb)
This commit is contained in:
parent
0a42c702ca
commit
2396887234
1 changed files with 9 additions and 16 deletions
|
|
@ -3900,13 +3900,19 @@ public final class ExoPlayerTest {
|
||||||
ShadowAudioManager shadowAudioManager = shadowOf(context.getSystemService(AudioManager.class));
|
ShadowAudioManager shadowAudioManager = shadowOf(context.getSystemService(AudioManager.class));
|
||||||
shadowAudioManager.setNextFocusRequestResponse(AudioManager.AUDIOFOCUS_REQUEST_FAILED);
|
shadowAudioManager.setNextFocusRequestResponse(AudioManager.AUDIOFOCUS_REQUEST_FAILED);
|
||||||
|
|
||||||
PlayerStateGrabber playerStateGrabber = new PlayerStateGrabber();
|
AtomicBoolean playWhenReady = new AtomicBoolean();
|
||||||
ActionSchedule actionSchedule =
|
ActionSchedule actionSchedule =
|
||||||
new ActionSchedule.Builder(TAG)
|
new ActionSchedule.Builder(TAG)
|
||||||
.setAudioAttributes(AudioAttributes.DEFAULT, /* handleAudioFocus= */ true)
|
.setAudioAttributes(AudioAttributes.DEFAULT, /* handleAudioFocus= */ true)
|
||||||
.play()
|
.play()
|
||||||
.waitForPlaybackState(Player.STATE_READY)
|
.waitForPlaybackState(Player.STATE_READY)
|
||||||
.executeRunnable(playerStateGrabber)
|
.executeRunnable(
|
||||||
|
new PlayerRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run(ExoPlayer player) {
|
||||||
|
playWhenReady.set(player.getPlayWhenReady());
|
||||||
|
}
|
||||||
|
})
|
||||||
.build();
|
.build();
|
||||||
AtomicBoolean seenPlaybackSuppression = new AtomicBoolean();
|
AtomicBoolean seenPlaybackSuppression = new AtomicBoolean();
|
||||||
Player.Listener listener =
|
Player.Listener listener =
|
||||||
|
|
@ -3924,7 +3930,7 @@ public final class ExoPlayerTest {
|
||||||
.start()
|
.start()
|
||||||
.blockUntilActionScheduleFinished(TIMEOUT_MS);
|
.blockUntilActionScheduleFinished(TIMEOUT_MS);
|
||||||
|
|
||||||
assertThat(playerStateGrabber.playWhenReady).isFalse();
|
assertThat(playWhenReady.get()).isFalse();
|
||||||
assertThat(seenPlaybackSuppression.get()).isFalse();
|
assertThat(seenPlaybackSuppression.get()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -12240,19 +12246,6 @@ public final class ExoPlayerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final class PlayerStateGrabber extends PlayerRunnable {
|
|
||||||
|
|
||||||
public boolean playWhenReady;
|
|
||||||
public @Player.State int playbackState;
|
|
||||||
@Nullable public Timeline timeline;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run(ExoPlayer player) {
|
|
||||||
playWhenReady = player.getPlayWhenReady();
|
|
||||||
playbackState = player.getPlaybackState();
|
|
||||||
timeline = player.getCurrentTimeline();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Provides a wrapper for a {@link Runnable} which does collect playback states and window counts.
|
* Provides a wrapper for a {@link Runnable} which does collect playback states and window counts.
|
||||||
* Can be used with {@link ActionSchedule.Builder#executeRunnable(Runnable)} to verify that a
|
* Can be used with {@link ActionSchedule.Builder#executeRunnable(Runnable)} to verify that a
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue