Commit 697f8416 by huangdarwin Committed by christosts

Test: Rename pixel tests for golden.

producesExpectedOutput -> matchesGoldenFile

PiperOrigin-RevId: 504863604
parent 76eb2d4f
...@@ -92,7 +92,7 @@ public final class CropPixelTest { ...@@ -92,7 +92,7 @@ public final class CropPixelTest {
} }
@Test @Test
public void drawFrame_noEdits_producesExpectedOutput() throws Exception { public void drawFrame_noEdits_matchesGoldenFile() throws Exception {
String testId = "drawFrame_noEdits"; String testId = "drawFrame_noEdits";
cropTextureProcessor = cropTextureProcessor =
new Crop(/* left= */ -1, /* right= */ 1, /* bottom= */ -1, /* top= */ 1) new Crop(/* left= */ -1, /* right= */ 1, /* bottom= */ -1, /* top= */ 1)
...@@ -113,7 +113,7 @@ public final class CropPixelTest { ...@@ -113,7 +113,7 @@ public final class CropPixelTest {
} }
@Test @Test
public void drawFrame_cropSmaller_producesExpectedOutput() throws Exception { public void drawFrame_cropSmaller_matchesGoldenFile() throws Exception {
String testId = "drawFrame_cropSmaller"; String testId = "drawFrame_cropSmaller";
cropTextureProcessor = cropTextureProcessor =
new Crop(/* left= */ -.9f, /* right= */ .1f, /* bottom= */ -1f, /* top= */ .5f) new Crop(/* left= */ -.9f, /* right= */ .1f, /* bottom= */ -1f, /* top= */ .5f)
...@@ -134,7 +134,7 @@ public final class CropPixelTest { ...@@ -134,7 +134,7 @@ public final class CropPixelTest {
} }
@Test @Test
public void drawFrame_cropLarger_producesExpectedOutput() throws Exception { public void drawFrame_cropLarger_matchesGoldenFile() throws Exception {
String testId = "drawFrame_cropLarger"; String testId = "drawFrame_cropLarger";
cropTextureProcessor = cropTextureProcessor =
new Crop(/* left= */ -2f, /* right= */ 2f, /* bottom= */ -1f, /* top= */ 2f) new Crop(/* left= */ -2f, /* right= */ 2f, /* bottom= */ -1f, /* top= */ 2f)
......
...@@ -162,7 +162,7 @@ public final class HslAdjustmentPixelTest { ...@@ -162,7 +162,7 @@ public final class HslAdjustmentPixelTest {
} }
@Test @Test
public void drawFrame_rotateHueByNegative90Degrees_producesExpectedOutput() throws Exception { public void drawFrame_rotateHueByNegative90Degrees_matchesGoldenFile() throws Exception {
String testId = "drawFrame_rotateHueByNegative90Degrees"; String testId = "drawFrame_rotateHueByNegative90Degrees";
HslAdjustment negativeHueRotation90Degrees = new HslAdjustment.Builder().adjustHue(-90).build(); HslAdjustment negativeHueRotation90Degrees = new HslAdjustment.Builder().adjustHue(-90).build();
hslProcessor = negativeHueRotation90Degrees.toGlTextureProcessor(context, /* useHdr= */ false); hslProcessor = negativeHueRotation90Degrees.toGlTextureProcessor(context, /* useHdr= */ false);
...@@ -180,7 +180,7 @@ public final class HslAdjustmentPixelTest { ...@@ -180,7 +180,7 @@ public final class HslAdjustmentPixelTest {
} }
@Test @Test
public void drawFrame_rotateHueBy60Degrees_producesExpectedOutput() throws Exception { public void drawFrame_rotateHueBy60Degrees_matchesGoldenFile() throws Exception {
String testId = "drawFrame_rotateHueBy60Degrees"; String testId = "drawFrame_rotateHueBy60Degrees";
HslAdjustment hueRotation60Degrees = new HslAdjustment.Builder().adjustHue(60).build(); HslAdjustment hueRotation60Degrees = new HslAdjustment.Builder().adjustHue(60).build();
hslProcessor = hueRotation60Degrees.toGlTextureProcessor(context, /* useHdr= */ false); hslProcessor = hueRotation60Degrees.toGlTextureProcessor(context, /* useHdr= */ false);
...@@ -309,7 +309,7 @@ public final class HslAdjustmentPixelTest { ...@@ -309,7 +309,7 @@ public final class HslAdjustmentPixelTest {
} }
@Test @Test
public void drawFrame_adjustAllHslSettings_producesExpectedOutput() throws Exception { public void drawFrame_adjustAllHslSettings_matchesGoldenFile() throws Exception {
String testId = "drawFrame_adjustAllHslSettings"; String testId = "drawFrame_adjustAllHslSettings";
HslAdjustment allHslSettingsAdjusted = HslAdjustment allHslSettingsAdjusted =
new HslAdjustment.Builder().adjustHue(60).adjustSaturation(30).adjustLightness(50).build(); new HslAdjustment.Builder().adjustHue(60).adjustSaturation(30).adjustLightness(50).build();
......
...@@ -97,7 +97,7 @@ public final class MatrixTextureProcessorPixelTest { ...@@ -97,7 +97,7 @@ public final class MatrixTextureProcessorPixelTest {
} }
@Test @Test
public void drawFrame_noEdits_producesExpectedOutput() throws Exception { public void drawFrame_noEdits_matchesGoldenFile() throws Exception {
String testId = "drawFrame_noEdits"; String testId = "drawFrame_noEdits";
Matrix identityMatrix = new Matrix(); Matrix identityMatrix = new Matrix();
MatrixTransformation noEditsTransformation = (long presentationTimeUs) -> identityMatrix; MatrixTransformation noEditsTransformation = (long presentationTimeUs) -> identityMatrix;
...@@ -117,7 +117,7 @@ public final class MatrixTextureProcessorPixelTest { ...@@ -117,7 +117,7 @@ public final class MatrixTextureProcessorPixelTest {
} }
@Test @Test
public void drawFrame_translateRight_producesExpectedOutput() throws Exception { public void drawFrame_translateRight_matchesGoldenFile() throws Exception {
String testId = "drawFrame_translateRight"; String testId = "drawFrame_translateRight";
Matrix translateRightMatrix = new Matrix(); Matrix translateRightMatrix = new Matrix();
translateRightMatrix.postTranslate(/* dx= */ 1, /* dy= */ 0); translateRightMatrix.postTranslate(/* dx= */ 1, /* dy= */ 0);
...@@ -139,7 +139,7 @@ public final class MatrixTextureProcessorPixelTest { ...@@ -139,7 +139,7 @@ public final class MatrixTextureProcessorPixelTest {
} }
@Test @Test
public void drawFrame_scaleNarrow_producesExpectedOutput() throws Exception { public void drawFrame_scaleNarrow_matchesGoldenFile() throws Exception {
String testId = "drawFrame_scaleNarrow"; String testId = "drawFrame_scaleNarrow";
Matrix scaleNarrowMatrix = new Matrix(); Matrix scaleNarrowMatrix = new Matrix();
scaleNarrowMatrix.postScale(.5f, 1.2f); scaleNarrowMatrix.postScale(.5f, 1.2f);
...@@ -160,7 +160,7 @@ public final class MatrixTextureProcessorPixelTest { ...@@ -160,7 +160,7 @@ public final class MatrixTextureProcessorPixelTest {
} }
@Test @Test
public void drawFrame_rotate90_producesExpectedOutput() throws Exception { public void drawFrame_rotate90_matchesGoldenFile() throws Exception {
String testId = "drawFrame_rotate90"; String testId = "drawFrame_rotate90";
Matrix rotate90Matrix = new Matrix(); Matrix rotate90Matrix = new Matrix();
rotate90Matrix.postRotate(/* degrees= */ 90); rotate90Matrix.postRotate(/* degrees= */ 90);
......
...@@ -101,7 +101,7 @@ public final class PresentationPixelTest { ...@@ -101,7 +101,7 @@ public final class PresentationPixelTest {
} }
@Test @Test
public void drawFrame_noEdits_producesExpectedOutput() throws Exception { public void drawFrame_noEdits_matchesGoldenFile() throws Exception {
String testId = "drawFrame_noEdits"; String testId = "drawFrame_noEdits";
presentationTextureProcessor = presentationTextureProcessor =
Presentation.createForHeight(C.LENGTH_UNSET) Presentation.createForHeight(C.LENGTH_UNSET)
...@@ -122,8 +122,7 @@ public final class PresentationPixelTest { ...@@ -122,8 +122,7 @@ public final class PresentationPixelTest {
} }
@Test @Test
public void drawFrame_changeAspectRatio_scaleToFit_narrow_producesExpectedOutput() public void drawFrame_changeAspectRatio_scaleToFit_narrow_matchesGoldenFile() throws Exception {
throws Exception {
String testId = "drawFrame_changeAspectRatio_scaleToFit_narrow"; String testId = "drawFrame_changeAspectRatio_scaleToFit_narrow";
presentationTextureProcessor = presentationTextureProcessor =
Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_SCALE_TO_FIT) Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_SCALE_TO_FIT)
...@@ -144,8 +143,7 @@ public final class PresentationPixelTest { ...@@ -144,8 +143,7 @@ public final class PresentationPixelTest {
} }
@Test @Test
public void drawFrame_changeAspectRatio_scaleToFit_wide_producesExpectedOutput() public void drawFrame_changeAspectRatio_scaleToFit_wide_matchesGoldenFile() throws Exception {
throws Exception {
String testId = "drawFrame_changeAspectRatio_scaleToFit_wide"; String testId = "drawFrame_changeAspectRatio_scaleToFit_wide";
presentationTextureProcessor = presentationTextureProcessor =
Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_SCALE_TO_FIT) Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_SCALE_TO_FIT)
...@@ -166,7 +164,7 @@ public final class PresentationPixelTest { ...@@ -166,7 +164,7 @@ public final class PresentationPixelTest {
} }
@Test @Test
public void drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow_producesExpectedOutput() public void drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow_matchesGoldenFile()
throws Exception { throws Exception {
String testId = "drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow"; String testId = "drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow";
presentationTextureProcessor = presentationTextureProcessor =
...@@ -189,7 +187,7 @@ public final class PresentationPixelTest { ...@@ -189,7 +187,7 @@ public final class PresentationPixelTest {
} }
@Test @Test
public void drawFrame_changeAspectRatio_scaleToFitWithCrop_wide_producesExpectedOutput() public void drawFrame_changeAspectRatio_scaleToFitWithCrop_wide_matchesGoldenFile()
throws Exception { throws Exception {
String testId = "drawFrame_changeAspectRatio_scaleToFitWithCrop_wide"; String testId = "drawFrame_changeAspectRatio_scaleToFitWithCrop_wide";
presentationTextureProcessor = presentationTextureProcessor =
...@@ -212,8 +210,7 @@ public final class PresentationPixelTest { ...@@ -212,8 +210,7 @@ public final class PresentationPixelTest {
} }
@Test @Test
public void drawFrame_changeAspectRatio_stretchToFit_narrow_producesExpectedOutput() public void drawFrame_changeAspectRatio_stretchToFit_narrow_matchesGoldenFile() throws Exception {
throws Exception {
String testId = "drawFrame_changeAspectRatio_stretchToFit_narrow"; String testId = "drawFrame_changeAspectRatio_stretchToFit_narrow";
presentationTextureProcessor = presentationTextureProcessor =
Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_STRETCH_TO_FIT) Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_STRETCH_TO_FIT)
...@@ -234,8 +231,7 @@ public final class PresentationPixelTest { ...@@ -234,8 +231,7 @@ public final class PresentationPixelTest {
} }
@Test @Test
public void drawFrame_changeAspectRatio_stretchToFit_wide_producesExpectedOutput() public void drawFrame_changeAspectRatio_stretchToFit_wide_matchesGoldenFile() throws Exception {
throws Exception {
String testId = "drawFrame_changeAspectRatio_stretchToFit_wide"; String testId = "drawFrame_changeAspectRatio_stretchToFit_wide";
presentationTextureProcessor = presentationTextureProcessor =
Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_STRETCH_TO_FIT) Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_STRETCH_TO_FIT)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment