Commit 227ac89e by ibaker Committed by kim-vde

Change TestPlayerRunHelper to fail-fast on playback error

If a test expects an error they can use runUntilError()

PiperOrigin-RevId: 382765060
parent ee488e66
......@@ -1715,7 +1715,7 @@ public final class ExoPlayerTest {
throw ExoPlaybackException.createForSource(new IOException());
})
.send();
runUntilPlaybackState(player, Player.STATE_IDLE);
TestPlayerRunHelper.runUntilError(player);
player.seekTo(/* positionMs= */ 50);
runUntilPendingCommandsAreFullyHandled(player);
long positionAfterSeekHandled = player.getCurrentPosition();
......@@ -9426,7 +9426,7 @@ public final class ExoPlayerTest {
TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY);
player.play();
player.setMediaItem(MediaItem.fromUri("http://this-will-throw-an-exception.mp4"));
TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_IDLE);
TestPlayerRunHelper.runUntilError(player);
runUntilPendingCommandsAreFullyHandled(player);
player.release();
......
......@@ -1662,7 +1662,7 @@ public final class AnalyticsCollectorTest {
TestPlayerRunHelper.runUntilPositionDiscontinuity(
player, Player.DISCONTINUITY_REASON_AUTO_TRANSITION);
player.setMediaItem(MediaItem.fromUri("http://this-will-throw-an-exception.mp4"));
TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_IDLE);
TestPlayerRunHelper.runUntilError(player);
ShadowLooper.runMainLooperToNextTask();
player.release();
surface.release();
......
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