Throw RuntimeException instead of Error from ExoHostedTest

Throwing Error forces a test to catch Throwable (e.g.
DashWidevineOfflineTest#widevineOfflineReleasedV22), which will also
catch AssertionError meaning the fail() call at the end of the try block
won't work.

The DashWidevineOfflineTest have been broken since
91185500a1

PiperOrigin-RevId: 331120894
This commit is contained in:
ibaker 2020-09-11 11:57:50 +01:00 committed by Oliver Woodman
parent b9ed9ee379
commit be68d13ba5

View File

@ -157,7 +157,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
@Override @Override
public final void onFinished() { public final void onFinished() {
if (failOnPlayerError && playerError != null) { if (failOnPlayerError && playerError != null) {
throw new Error(playerError); throw new RuntimeException(playerError);
} }
logMetrics(audioDecoderCounters, videoDecoderCounters); logMetrics(audioDecoderCounters, videoDecoderCounters);
if (expectedPlayingTimeMs != EXPECTED_PLAYING_TIME_UNSET) { if (expectedPlayingTimeMs != EXPECTED_PLAYING_TIME_UNSET) {