mirror of
https://github.com/samsonjs/media.git
synced 2026-04-19 13:35:47 +00:00
Enable offload tests
Add additional assertions to try to figure out why the tests are flaky when run in the test harness. Failure could not be reproduced locally even after 4000 run. PiperOrigin-RevId: 362282251
This commit is contained in:
parent
0c9b02bf44
commit
a4ad351fb1
2 changed files with 8 additions and 6 deletions
|
|
@ -128,7 +128,6 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
|
|
@ -8574,7 +8573,6 @@ public final class ExoPlayerTest {
|
|||
assertThat(runUntilReceiveOffloadSchedulingEnabledNewState(player)).isFalse();
|
||||
}
|
||||
|
||||
@Ignore // See [internal: b/170387438]
|
||||
@Test
|
||||
public void enableOffloadSchedulingWhileSleepingForOffload_isDisabled_isReported()
|
||||
throws Exception {
|
||||
|
|
@ -8592,7 +8590,6 @@ public final class ExoPlayerTest {
|
|||
assertThat(runUntilReceiveOffloadSchedulingEnabledNewState(player)).isFalse();
|
||||
}
|
||||
|
||||
@Ignore // See [internal: b/170387438]
|
||||
@Test
|
||||
public void enableOffloadScheduling_isEnable_playerSleeps() throws Exception {
|
||||
FakeSleepRenderer sleepRenderer = new FakeSleepRenderer(C.TRACK_TYPE_AUDIO);
|
||||
|
|
@ -8609,7 +8606,6 @@ public final class ExoPlayerTest {
|
|||
assertThat(player.experimentalIsSleepingForOffload()).isTrue();
|
||||
}
|
||||
|
||||
@Ignore // See [internal: b/170387438]
|
||||
@Test
|
||||
public void
|
||||
experimentalEnableOffloadSchedulingWhileSleepingForOffload_isDisabled_renderingResumes()
|
||||
|
|
@ -8630,7 +8626,6 @@ public final class ExoPlayerTest {
|
|||
runUntilPlaybackState(player, Player.STATE_ENDED);
|
||||
}
|
||||
|
||||
@Ignore // See [internal: b/170387438]
|
||||
@Test
|
||||
public void wakeupListenerWhileSleepingForOffload_isWokenUp_renderingResumes() throws Exception {
|
||||
FakeSleepRenderer sleepRenderer = new FakeSleepRenderer(C.TRACK_TYPE_AUDIO).sleepOnNextRender();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
package com.google.android.exoplayer2.robolectric;
|
||||
|
||||
import static com.google.android.exoplayer2.robolectric.RobolectricUtil.runMainLooperUntil;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import android.os.Looper;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
|
|
@ -257,7 +258,13 @@ public class TestPlayerRunHelper {
|
|||
}
|
||||
};
|
||||
player.addListener(listener);
|
||||
runMainLooperUntil(receiverCallback::get);
|
||||
runMainLooperUntil(
|
||||
() -> { // Make sure progress is being made, see [internal: b/170387438#comment2]
|
||||
assertThat(player.getPlayerError()).isNull();
|
||||
assertThat(player.getPlayWhenReady()).isTrue();
|
||||
assertThat(player.getPlaybackState()).isAnyOf(Player.STATE_BUFFERING, Player.STATE_READY);
|
||||
return receiverCallback.get();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue