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
f8320287
authored
Jun 21, 2021
by
ibaker
Committed by
Oliver Woodman
Jun 21, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Simplify FileDataSourceContractTest
#minor-release PiperOrigin-RevId: 380531272
parent
b05e8f50
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
library/core/src/test/java/com/google/android/exoplayer2/upstream/FileDataSourceContractTest.java
library/core/src/test/java/com/google/android/exoplayer2/upstream/FileDataSourceContractTest.java
View file @
f8320287
...
...
@@ -21,7 +21,6 @@ import com.google.android.exoplayer2.testutil.DataSourceContractTest;
import
com.google.android.exoplayer2.testutil.TestUtil
;
import
com.google.common.collect.ImmutableList
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
org.junit.Before
;
...
...
@@ -37,21 +36,19 @@ public class FileDataSourceContractTest extends DataSourceContractTest {
@Rule
public
final
TemporaryFolder
tempFolder
=
new
TemporaryFolder
();
private
Uri
simpleU
ri
;
private
Uri
u
ri
;
@Before
public
void
writeFiles
()
throws
Exception
{
simpleUri
=
writeFile
(
DATA
);
public
void
writeFile
()
throws
Exception
{
File
file
=
tempFolder
.
newFile
();
Files
.
write
(
Paths
.
get
(
file
.
getAbsolutePath
()),
DATA
);
uri
=
Uri
.
fromFile
(
file
);
}
@Override
protected
ImmutableList
<
TestResource
>
getTestResources
()
{
return
ImmutableList
.
of
(
new
TestResource
.
Builder
()
.
setName
(
"simple"
)
.
setUri
(
simpleUri
)
.
setExpectedBytes
(
DATA
)
.
build
());
new
TestResource
.
Builder
().
setName
(
"simple"
).
setUri
(
uri
).
setExpectedBytes
(
DATA
).
build
());
}
@Override
...
...
@@ -63,10 +60,4 @@ public class FileDataSourceContractTest extends DataSourceContractTest {
protected
DataSource
createDataSource
()
{
return
new
FileDataSource
();
}
private
Uri
writeFile
(
byte
[]
data
)
throws
IOException
{
File
file
=
tempFolder
.
newFile
();
Files
.
write
(
Paths
.
get
(
file
.
getAbsolutePath
()),
data
);
return
Uri
.
fromFile
(
file
);
}
}
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