mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Transformer: remove unused bitmap test option.
Remove unused saveTestBitmapToCacheDirectory throwOnFailure option. #cleanup PiperOrigin-RevId: 444516857
This commit is contained in:
parent
877ba22b20
commit
b29d49637e
5 changed files with 48 additions and 57 deletions
|
|
@ -98,8 +98,8 @@ public final class AdvancedFrameProcessorPixelTest {
|
||||||
Bitmap actualBitmap =
|
Bitmap actualBitmap =
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -120,8 +120,8 @@ public final class AdvancedFrameProcessorPixelTest {
|
||||||
Bitmap actualBitmap =
|
Bitmap actualBitmap =
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -142,8 +142,8 @@ public final class AdvancedFrameProcessorPixelTest {
|
||||||
Bitmap actualBitmap =
|
Bitmap actualBitmap =
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -164,8 +164,8 @@ public final class AdvancedFrameProcessorPixelTest {
|
||||||
Bitmap actualBitmap =
|
Bitmap actualBitmap =
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(width, height);
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,8 @@ public class BitmapTestUtil {
|
||||||
* of pixels in the image. The bitmap resolutions must match and they must use configuration
|
* of pixels in the image. The bitmap resolutions must match and they must use configuration
|
||||||
* {@link Bitmap.Config#ARGB_8888}.
|
* {@link Bitmap.Config#ARGB_8888}.
|
||||||
*
|
*
|
||||||
|
* <p>Tries to save a difference bitmap between expected and actual bitmaps.
|
||||||
|
*
|
||||||
* @param expected The expected {@link Bitmap}.
|
* @param expected The expected {@link Bitmap}.
|
||||||
* @param actual The actual {@link Bitmap} produced by the test.
|
* @param actual The actual {@link Bitmap} produced by the test.
|
||||||
* @param testId The name of the test that produced the {@link Bitmap}, or {@code null} if the
|
* @param testId The name of the test that produced the {@link Bitmap}, or {@code null} if the
|
||||||
|
|
@ -148,43 +150,32 @@ public class BitmapTestUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (testId != null) {
|
if (testId != null) {
|
||||||
try {
|
maybeSaveTestBitmapToCacheDirectory(testId, "diff", differencesBitmap);
|
||||||
saveTestBitmapToCacheDirectory(
|
|
||||||
testId, "diff", differencesBitmap, /* throwOnFailure= */ false);
|
|
||||||
} catch (IOException impossible) {
|
|
||||||
throw new IllegalStateException(impossible);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return (float) sumMaximumAbsoluteDifferences / (width * height);
|
return (float) sumMaximumAbsoluteDifferences / (width * height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the {@link Bitmap} to the {@link Context#getCacheDir() cache directory} as a PNG.
|
* Tries to save the {@link Bitmap} to the {@link Context#getCacheDir() cache directory} as a PNG.
|
||||||
*
|
*
|
||||||
* <p>File name will be {@code <testId>_<bitmapLabel>.png}. If {@code throwOnFailure} is {@code
|
* <p>File name will be {@code <testId>_<bitmapLabel>.png}. If the file failed to write, any
|
||||||
* false}, any {@link IOException} will be caught and logged.
|
* {@link IOException} will be caught and logged.
|
||||||
*
|
*
|
||||||
* @param testId Name of the test that produced the {@link Bitmap}.
|
* @param testId Name of the test that produced the {@link Bitmap}.
|
||||||
* @param bitmapLabel Label to identify the bitmap.
|
* @param bitmapLabel Label to identify the bitmap.
|
||||||
* @param bitmap The {@link Bitmap} to save.
|
* @param bitmap The {@link Bitmap} to save.
|
||||||
* @param throwOnFailure Whether to throw an exception if the bitmap can't be saved.
|
|
||||||
* @throws IOException If the bitmap can't be saved and {@code throwOnFailure} is {@code true}.
|
|
||||||
*/
|
*/
|
||||||
public static void saveTestBitmapToCacheDirectory(
|
public static void maybeSaveTestBitmapToCacheDirectory(
|
||||||
String testId, String bitmapLabel, Bitmap bitmap, boolean throwOnFailure) throws IOException {
|
String testId, String bitmapLabel, Bitmap bitmap) {
|
||||||
File file =
|
File file =
|
||||||
new File(
|
new File(
|
||||||
getApplicationContext().getExternalCacheDir(), testId + "_" + bitmapLabel + ".png");
|
getApplicationContext().getExternalCacheDir(), testId + "_" + bitmapLabel + ".png");
|
||||||
try (FileOutputStream outputStream = new FileOutputStream(file)) {
|
try (FileOutputStream outputStream = new FileOutputStream(file)) {
|
||||||
bitmap.compress(Bitmap.CompressFormat.PNG, /* quality= */ 100, outputStream);
|
bitmap.compress(Bitmap.CompressFormat.PNG, /* quality= */ 100, outputStream);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (throwOnFailure) {
|
|
||||||
throw e;
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "Could not write Bitmap to file path: " + file.getAbsolutePath(), e);
|
Log.e(TAG, "Could not write Bitmap to file path: " + file.getAbsolutePath(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a bitmap with the values of the current OpenGL framebuffer.
|
* Creates a bitmap with the values of the current OpenGL framebuffer.
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,8 @@ public final class FrameProcessorChainPixelTest {
|
||||||
|
|
||||||
Bitmap actualBitmap = processFirstFrameAndEnd();
|
Bitmap actualBitmap = processFirstFrameAndEnd();
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -116,8 +116,8 @@ public final class FrameProcessorChainPixelTest {
|
||||||
|
|
||||||
Bitmap actualBitmap = processFirstFrameAndEnd();
|
Bitmap actualBitmap = processFirstFrameAndEnd();
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -140,8 +140,8 @@ public final class FrameProcessorChainPixelTest {
|
||||||
|
|
||||||
Bitmap actualBitmap = processFirstFrameAndEnd();
|
Bitmap actualBitmap = processFirstFrameAndEnd();
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -164,8 +164,8 @@ public final class FrameProcessorChainPixelTest {
|
||||||
|
|
||||||
Bitmap actualBitmap = processFirstFrameAndEnd();
|
Bitmap actualBitmap = processFirstFrameAndEnd();
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -184,8 +184,8 @@ public final class FrameProcessorChainPixelTest {
|
||||||
|
|
||||||
Bitmap actualBitmap = processFirstFrameAndEnd();
|
Bitmap actualBitmap = processFirstFrameAndEnd();
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -204,8 +204,8 @@ public final class FrameProcessorChainPixelTest {
|
||||||
|
|
||||||
Bitmap actualBitmap = processFirstFrameAndEnd();
|
Bitmap actualBitmap = processFirstFrameAndEnd();
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
|
||||||
|
|
@ -109,8 +109,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -136,8 +136,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -163,8 +163,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -192,8 +192,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -221,8 +221,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -250,8 +250,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -279,8 +279,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -308,8 +308,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
@ -337,8 +337,8 @@ public final class PresentationFrameProcessorPixelTest {
|
||||||
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
BitmapTestUtil.createArgb8888BitmapFromCurrentGlFramebuffer(
|
||||||
outputSize.getWidth(), outputSize.getHeight());
|
outputSize.getWidth(), outputSize.getHeight());
|
||||||
|
|
||||||
BitmapTestUtil.saveTestBitmapToCacheDirectory(
|
BitmapTestUtil.maybeSaveTestBitmapToCacheDirectory(
|
||||||
testId, /* bitmapLabel= */ "actual", actualBitmap, /* throwOnFailure= */ false);
|
testId, /* bitmapLabel= */ "actual", actualBitmap);
|
||||||
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
// TODO(b/207848601): switch to using proper tooling for testing against golden data.
|
||||||
float averagePixelAbsoluteDifference =
|
float averagePixelAbsoluteDifference =
|
||||||
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
BitmapTestUtil.getAveragePixelAbsoluteDifferenceArgb8888(
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ public class TransformationTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void transformToSpecificBitrate() throws Exception {
|
public void transformToSpecificBitrate() throws Exception {
|
||||||
String testId = TAG + "_transformWithSpecificBitrate";
|
String testId = TAG + "_transformToSpecificBitrate";
|
||||||
Context context = ApplicationProvider.getApplicationContext();
|
Context context = ApplicationProvider.getApplicationContext();
|
||||||
Transformer transformer =
|
Transformer transformer =
|
||||||
new Transformer.Builder(context)
|
new Transformer.Builder(context)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue