mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Make it easier to update extractor test dump files
PiperOrigin-RevId: 285407744
This commit is contained in:
parent
052550e90e
commit
80e3152e8c
1 changed files with 7 additions and 5 deletions
|
|
@ -33,9 +33,11 @@ import java.io.PrintWriter;
|
|||
public final class FakeExtractorOutput implements ExtractorOutput, Dumper.Dumpable {
|
||||
|
||||
/**
|
||||
* If true, makes {@link #assertOutput(Context, String)} method write dump result to {@code
|
||||
* /sdcard/Android/data/apk_package/ + dumpfile} file instead of comparing it with an existing
|
||||
* file.
|
||||
* If true, makes {@link #assertOutput(Context, String)} method write the output to the dump file,
|
||||
* rather than validating that the output matches what the dump file already contains.
|
||||
*
|
||||
* <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;
|
||||
|
||||
|
|
@ -121,8 +123,8 @@ public final class FakeExtractorOutput implements ExtractorOutput, Dumper.Dumpab
|
|||
String actual = new Dumper().add(this).toString();
|
||||
|
||||
if (WRITE_DUMP) {
|
||||
File directory = context.getExternalFilesDir(null);
|
||||
File file = new File(directory, dumpFile);
|
||||
File file = new File(System.getProperty("user.dir"), "src/test/assets");
|
||||
file = new File(file, dumpFile);
|
||||
file.getParentFile().mkdirs();
|
||||
PrintWriter out = new PrintWriter(file);
|
||||
out.print(actual);
|
||||
|
|
|
|||
Loading…
Reference in a new issue