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
80e3152e
authored
Dec 13, 2019
by
olly
Committed by
Oliver Woodman
Jan 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make it easier to update extractor test dump files
PiperOrigin-RevId: 285407744
parent
052550e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeExtractorOutput.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/FakeExtractorOutput.java
View file @
80e3152e
...
@@ -33,9 +33,11 @@ import java.io.PrintWriter;
...
@@ -33,9 +33,11 @@ import java.io.PrintWriter;
public
final
class
FakeExtractorOutput
implements
ExtractorOutput
,
Dumper
.
Dumpable
{
public
final
class
FakeExtractorOutput
implements
ExtractorOutput
,
Dumper
.
Dumpable
{
/**
/**
* If true, makes {@link #assertOutput(Context, String)} method write dump result to {@code
* If true, makes {@link #assertOutput(Context, String)} method write the output to the dump file,
* /sdcard/Android/data/apk_package/ + dumpfile} file instead of comparing it with an existing
* rather than validating that the output matches what the dump file already contains.
* file.
*
* <p>Enabling this option works when tests are run in Android Studio. It may not work when the
* tests are run in another environment.
*/
*/
private
static
final
boolean
WRITE_DUMP
=
false
;
private
static
final
boolean
WRITE_DUMP
=
false
;
...
@@ -121,8 +123,8 @@ public final class FakeExtractorOutput implements ExtractorOutput, Dumper.Dumpab
...
@@ -121,8 +123,8 @@ public final class FakeExtractorOutput implements ExtractorOutput, Dumper.Dumpab
String
actual
=
new
Dumper
().
add
(
this
).
toString
();
String
actual
=
new
Dumper
().
add
(
this
).
toString
();
if
(
WRITE_DUMP
)
{
if
(
WRITE_DUMP
)
{
File
directory
=
context
.
getExternalFilesDir
(
null
);
File
file
=
new
File
(
System
.
getProperty
(
"user.dir"
),
"src/test/assets"
);
File
file
=
new
File
(
directory
,
dumpFile
);
file
=
new
File
(
file
,
dumpFile
);
file
.
getParentFile
().
mkdirs
();
file
.
getParentFile
().
mkdirs
();
PrintWriter
out
=
new
PrintWriter
(
file
);
PrintWriter
out
=
new
PrintWriter
(
file
);
out
.
print
(
actual
);
out
.
print
(
actual
);
...
...
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