From be68d13ba56019395e32c934ae35618ccf6c6bac Mon Sep 17 00:00:00 2001 From: ibaker Date: Fri, 11 Sep 2020 11:57:50 +0100 Subject: [PATCH] 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 https://github.com/google/ExoPlayer/commit/91185500a1242b99b86b18bc9f3449d3dac1fa01 PiperOrigin-RevId: 331120894 --- .../com/google/android/exoplayer2/testutil/ExoHostedTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java index 5eececd88e..fbdd9590aa 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/ExoHostedTest.java @@ -157,7 +157,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest { @Override public final void onFinished() { if (failOnPlayerError && playerError != null) { - throw new Error(playerError); + throw new RuntimeException(playerError); } logMetrics(audioDecoderCounters, videoDecoderCounters); if (expectedPlayingTimeMs != EXPECTED_PLAYING_TIME_UNSET) {