From 697f84161d90efd902be477738366d2092767257 Mon Sep 17 00:00:00 2001 From: huangdarwin Date: Thu, 26 Jan 2023 17:30:27 +0000 Subject: [PATCH] Test: Rename pixel tests for golden. producesExpectedOutput -> matchesGoldenFile PiperOrigin-RevId: 504863604 --- .../androidx/media3/effect/CropPixelTest.java | 6 +++--- .../media3/effect/HslAdjustmentPixelTest.java | 6 +++--- .../MatrixTextureProcessorPixelTest.java | 8 ++++---- .../media3/effect/PresentationPixelTest.java | 18 +++++++----------- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/libraries/effect/src/androidTest/java/androidx/media3/effect/CropPixelTest.java b/libraries/effect/src/androidTest/java/androidx/media3/effect/CropPixelTest.java index 61b6830892..65cff67d14 100644 --- a/libraries/effect/src/androidTest/java/androidx/media3/effect/CropPixelTest.java +++ b/libraries/effect/src/androidTest/java/androidx/media3/effect/CropPixelTest.java @@ -92,7 +92,7 @@ public final class CropPixelTest { } @Test - public void drawFrame_noEdits_producesExpectedOutput() throws Exception { + public void drawFrame_noEdits_matchesGoldenFile() throws Exception { String testId = "drawFrame_noEdits"; cropTextureProcessor = new Crop(/* left= */ -1, /* right= */ 1, /* bottom= */ -1, /* top= */ 1) @@ -113,7 +113,7 @@ public final class CropPixelTest { } @Test - public void drawFrame_cropSmaller_producesExpectedOutput() throws Exception { + public void drawFrame_cropSmaller_matchesGoldenFile() throws Exception { String testId = "drawFrame_cropSmaller"; cropTextureProcessor = new Crop(/* left= */ -.9f, /* right= */ .1f, /* bottom= */ -1f, /* top= */ .5f) @@ -134,7 +134,7 @@ public final class CropPixelTest { } @Test - public void drawFrame_cropLarger_producesExpectedOutput() throws Exception { + public void drawFrame_cropLarger_matchesGoldenFile() throws Exception { String testId = "drawFrame_cropLarger"; cropTextureProcessor = new Crop(/* left= */ -2f, /* right= */ 2f, /* bottom= */ -1f, /* top= */ 2f) diff --git a/libraries/effect/src/androidTest/java/androidx/media3/effect/HslAdjustmentPixelTest.java b/libraries/effect/src/androidTest/java/androidx/media3/effect/HslAdjustmentPixelTest.java index 22d4824e48..5256ef5237 100644 --- a/libraries/effect/src/androidTest/java/androidx/media3/effect/HslAdjustmentPixelTest.java +++ b/libraries/effect/src/androidTest/java/androidx/media3/effect/HslAdjustmentPixelTest.java @@ -162,7 +162,7 @@ public final class HslAdjustmentPixelTest { } @Test - public void drawFrame_rotateHueByNegative90Degrees_producesExpectedOutput() throws Exception { + public void drawFrame_rotateHueByNegative90Degrees_matchesGoldenFile() throws Exception { String testId = "drawFrame_rotateHueByNegative90Degrees"; HslAdjustment negativeHueRotation90Degrees = new HslAdjustment.Builder().adjustHue(-90).build(); hslProcessor = negativeHueRotation90Degrees.toGlTextureProcessor(context, /* useHdr= */ false); @@ -180,7 +180,7 @@ public final class HslAdjustmentPixelTest { } @Test - public void drawFrame_rotateHueBy60Degrees_producesExpectedOutput() throws Exception { + public void drawFrame_rotateHueBy60Degrees_matchesGoldenFile() throws Exception { String testId = "drawFrame_rotateHueBy60Degrees"; HslAdjustment hueRotation60Degrees = new HslAdjustment.Builder().adjustHue(60).build(); hslProcessor = hueRotation60Degrees.toGlTextureProcessor(context, /* useHdr= */ false); @@ -309,7 +309,7 @@ public final class HslAdjustmentPixelTest { } @Test - public void drawFrame_adjustAllHslSettings_producesExpectedOutput() throws Exception { + public void drawFrame_adjustAllHslSettings_matchesGoldenFile() throws Exception { String testId = "drawFrame_adjustAllHslSettings"; HslAdjustment allHslSettingsAdjusted = new HslAdjustment.Builder().adjustHue(60).adjustSaturation(30).adjustLightness(50).build(); diff --git a/libraries/effect/src/androidTest/java/androidx/media3/effect/MatrixTextureProcessorPixelTest.java b/libraries/effect/src/androidTest/java/androidx/media3/effect/MatrixTextureProcessorPixelTest.java index 161121ea94..02e4957953 100644 --- a/libraries/effect/src/androidTest/java/androidx/media3/effect/MatrixTextureProcessorPixelTest.java +++ b/libraries/effect/src/androidTest/java/androidx/media3/effect/MatrixTextureProcessorPixelTest.java @@ -97,7 +97,7 @@ public final class MatrixTextureProcessorPixelTest { } @Test - public void drawFrame_noEdits_producesExpectedOutput() throws Exception { + public void drawFrame_noEdits_matchesGoldenFile() throws Exception { String testId = "drawFrame_noEdits"; Matrix identityMatrix = new Matrix(); MatrixTransformation noEditsTransformation = (long presentationTimeUs) -> identityMatrix; @@ -117,7 +117,7 @@ public final class MatrixTextureProcessorPixelTest { } @Test - public void drawFrame_translateRight_producesExpectedOutput() throws Exception { + public void drawFrame_translateRight_matchesGoldenFile() throws Exception { String testId = "drawFrame_translateRight"; Matrix translateRightMatrix = new Matrix(); translateRightMatrix.postTranslate(/* dx= */ 1, /* dy= */ 0); @@ -139,7 +139,7 @@ public final class MatrixTextureProcessorPixelTest { } @Test - public void drawFrame_scaleNarrow_producesExpectedOutput() throws Exception { + public void drawFrame_scaleNarrow_matchesGoldenFile() throws Exception { String testId = "drawFrame_scaleNarrow"; Matrix scaleNarrowMatrix = new Matrix(); scaleNarrowMatrix.postScale(.5f, 1.2f); @@ -160,7 +160,7 @@ public final class MatrixTextureProcessorPixelTest { } @Test - public void drawFrame_rotate90_producesExpectedOutput() throws Exception { + public void drawFrame_rotate90_matchesGoldenFile() throws Exception { String testId = "drawFrame_rotate90"; Matrix rotate90Matrix = new Matrix(); rotate90Matrix.postRotate(/* degrees= */ 90); diff --git a/libraries/effect/src/androidTest/java/androidx/media3/effect/PresentationPixelTest.java b/libraries/effect/src/androidTest/java/androidx/media3/effect/PresentationPixelTest.java index 86d593749d..e8ad755eb7 100644 --- a/libraries/effect/src/androidTest/java/androidx/media3/effect/PresentationPixelTest.java +++ b/libraries/effect/src/androidTest/java/androidx/media3/effect/PresentationPixelTest.java @@ -101,7 +101,7 @@ public final class PresentationPixelTest { } @Test - public void drawFrame_noEdits_producesExpectedOutput() throws Exception { + public void drawFrame_noEdits_matchesGoldenFile() throws Exception { String testId = "drawFrame_noEdits"; presentationTextureProcessor = Presentation.createForHeight(C.LENGTH_UNSET) @@ -122,8 +122,7 @@ public final class PresentationPixelTest { } @Test - public void drawFrame_changeAspectRatio_scaleToFit_narrow_producesExpectedOutput() - throws Exception { + public void drawFrame_changeAspectRatio_scaleToFit_narrow_matchesGoldenFile() throws Exception { String testId = "drawFrame_changeAspectRatio_scaleToFit_narrow"; presentationTextureProcessor = Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_SCALE_TO_FIT) @@ -144,8 +143,7 @@ public final class PresentationPixelTest { } @Test - public void drawFrame_changeAspectRatio_scaleToFit_wide_producesExpectedOutput() - throws Exception { + public void drawFrame_changeAspectRatio_scaleToFit_wide_matchesGoldenFile() throws Exception { String testId = "drawFrame_changeAspectRatio_scaleToFit_wide"; presentationTextureProcessor = Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_SCALE_TO_FIT) @@ -166,7 +164,7 @@ public final class PresentationPixelTest { } @Test - public void drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow_producesExpectedOutput() + public void drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow_matchesGoldenFile() throws Exception { String testId = "drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow"; presentationTextureProcessor = @@ -189,7 +187,7 @@ public final class PresentationPixelTest { } @Test - public void drawFrame_changeAspectRatio_scaleToFitWithCrop_wide_producesExpectedOutput() + public void drawFrame_changeAspectRatio_scaleToFitWithCrop_wide_matchesGoldenFile() throws Exception { String testId = "drawFrame_changeAspectRatio_scaleToFitWithCrop_wide"; presentationTextureProcessor = @@ -212,8 +210,7 @@ public final class PresentationPixelTest { } @Test - public void drawFrame_changeAspectRatio_stretchToFit_narrow_producesExpectedOutput() - throws Exception { + public void drawFrame_changeAspectRatio_stretchToFit_narrow_matchesGoldenFile() throws Exception { String testId = "drawFrame_changeAspectRatio_stretchToFit_narrow"; presentationTextureProcessor = Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_STRETCH_TO_FIT) @@ -234,8 +231,7 @@ public final class PresentationPixelTest { } @Test - public void drawFrame_changeAspectRatio_stretchToFit_wide_producesExpectedOutput() - throws Exception { + public void drawFrame_changeAspectRatio_stretchToFit_wide_matchesGoldenFile() throws Exception { String testId = "drawFrame_changeAspectRatio_stretchToFit_wide"; presentationTextureProcessor = Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_STRETCH_TO_FIT)