From ff4516086cebdada482cf52e2794354e33c17d5b Mon Sep 17 00:00:00 2001 From: ibaker Date: Tue, 14 Jul 2020 10:27:05 +0100 Subject: [PATCH] Migrate usages of deprecated InvalidResponseCodeException constructor PiperOrigin-RevId: 321121988 --- .../DefaultLoadErrorHandlingPolicyTest.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java b/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java index 4adeab560a..50b06c14db 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java @@ -25,6 +25,7 @@ import com.google.android.exoplayer2.source.LoadEventInfo; import com.google.android.exoplayer2.source.MediaLoadData; import com.google.android.exoplayer2.upstream.HttpDataSource.InvalidResponseCodeException; import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy.LoadErrorInfo; +import com.google.android.exoplayer2.util.Util; import java.io.IOException; import java.util.Collections; import org.junit.Test; @@ -50,7 +51,11 @@ public final class DefaultLoadErrorHandlingPolicyTest { public void getExclusionDurationMsFor_responseCode404() { InvalidResponseCodeException exception = new InvalidResponseCodeException( - 404, "Not Found", Collections.emptyMap(), new DataSpec(Uri.EMPTY)); + 404, + "Not Found", + Collections.emptyMap(), + new DataSpec(Uri.EMPTY), + /* responseBody= */ Util.EMPTY_BYTE_ARRAY); assertThat(getDefaultPolicyExclusionDurationMsFor(exception)) .isEqualTo(DefaultLoadErrorHandlingPolicy.DEFAULT_TRACK_BLACKLIST_MS); } @@ -59,7 +64,11 @@ public final class DefaultLoadErrorHandlingPolicyTest { public void getExclusionDurationMsFor_responseCode410() { InvalidResponseCodeException exception = new InvalidResponseCodeException( - 410, "Gone", Collections.emptyMap(), new DataSpec(Uri.EMPTY)); + 410, + "Gone", + Collections.emptyMap(), + new DataSpec(Uri.EMPTY), + /* responseBody= */ Util.EMPTY_BYTE_ARRAY); assertThat(getDefaultPolicyExclusionDurationMsFor(exception)) .isEqualTo(DefaultLoadErrorHandlingPolicy.DEFAULT_TRACK_BLACKLIST_MS); } @@ -68,7 +77,11 @@ public final class DefaultLoadErrorHandlingPolicyTest { public void getExclusionDurationMsFor_dontExcludeUnexpectedHttpCodes() { InvalidResponseCodeException exception = new InvalidResponseCodeException( - 500, "Internal Server Error", Collections.emptyMap(), new DataSpec(Uri.EMPTY)); + 500, + "Internal Server Error", + Collections.emptyMap(), + new DataSpec(Uri.EMPTY), + /* responseBody= */ Util.EMPTY_BYTE_ARRAY); assertThat(getDefaultPolicyExclusionDurationMsFor(exception)).isEqualTo(C.TIME_UNSET); }