Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ff451608
authored
Jul 14, 2020
by
ibaker
Committed by
Oliver Woodman
Jul 24, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Migrate usages of deprecated InvalidResponseCodeException constructor
PiperOrigin-RevId: 321121988
parent
b48a762f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java
library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java
View file @
ff451608
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment