use of com.google.android.exoplayer2.upstream.HttpDataSource.InvalidResponseCodeException in project ExoPlayer by google.
the class DefaultLoadErrorHandlingPolicyTest method getFallbackSelectionFor_responseCode404.
@Test
public void getFallbackSelectionFor_responseCode404() {
InvalidResponseCodeException exception = buildInvalidResponseCodeException(404, "Not found");
@Nullable LoadErrorHandlingPolicy.FallbackSelection defaultPolicyFallbackSelection = getDefaultPolicyFallbackSelection(exception, /* numberOfLocations= */
1, /* numberOfExcludedLocations= */
0, /* numberOfTracks= */
10, /* numberOfExcludedTracks= */
0);
assertThat(defaultPolicyFallbackSelection.type).isEqualTo(FALLBACK_TYPE_TRACK);
assertThat(defaultPolicyFallbackSelection.exclusionDurationMs).isEqualTo(DEFAULT_TRACK_EXCLUSION_MS);
defaultPolicyFallbackSelection = getDefaultPolicyFallbackSelection(exception, /* numberOfLocations= */
2, /* numberOfExcludedLocations= */
0, /* numberOfTracks= */
4, /* numberOfExcludedTracks= */
1);
assertThat(defaultPolicyFallbackSelection.type).isEqualTo(FALLBACK_TYPE_LOCATION);
assertThat(defaultPolicyFallbackSelection.exclusionDurationMs).isEqualTo(DEFAULT_LOCATION_EXCLUSION_MS);
}
Aggregations