mirror of
https://github.com/androidx/media.git
synced 2025-05-18 04:59:54 +08:00
Deflake ExoPlayerScrubbingTest
Instead of waiting for pending commands to complete as a proxy for 'the requested seek(s) completed', we wait until the corresponding playback position. PiperOrigin-RevId: 756276867
This commit is contained in:
parent
81e4488f0a
commit
9073c2b28d
@ -135,14 +135,14 @@ public final class ExoPlayerScrubbingTest {
|
|||||||
player.seekTo(3000);
|
player.seekTo(3000);
|
||||||
player.seekTo(3500);
|
player.seekTo(3500);
|
||||||
// Allow the 2500 and 3500 seeks to complete (the 3000 seek should be dropped).
|
// Allow the 2500 and 3500 seeks to complete (the 3000 seek should be dropped).
|
||||||
advance(player).untilPendingCommandsAreFullyHandled();
|
advance(player).untilPosition(/* mediaItemIndex= */ 0, /* positionMs= */ 3500);
|
||||||
|
|
||||||
player.seekTo(4000);
|
player.seekTo(4000);
|
||||||
player.seekTo(4500);
|
player.seekTo(4500);
|
||||||
// Disabling scrubbing mode should immediately execute the last received seek (pre-empting a
|
// Disabling scrubbing mode should immediately execute the last received seek (pre-empting a
|
||||||
// previous one), so we expect the 4500 seek to be resolved and the 4000 seek to be dropped.
|
// previous one), so we expect the 4500 seek to be resolved and the 4000 seek to be dropped.
|
||||||
player.setScrubbingModeEnabled(false);
|
player.setScrubbingModeEnabled(false);
|
||||||
advance(player).untilPendingCommandsAreFullyHandled();
|
advance(player).untilPosition(/* mediaItemIndex= */ 0, /* positionMs= */ 4500);
|
||||||
player.clearVideoFrameMetadataListener(mockVideoFrameMetadataListener);
|
player.clearVideoFrameMetadataListener(mockVideoFrameMetadataListener);
|
||||||
advance(player).untilState(Player.STATE_ENDED);
|
advance(player).untilState(Player.STATE_ENDED);
|
||||||
player.release();
|
player.release();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user