mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Test: Rename pixel tests for golden.
producesExpectedOutput -> matchesGoldenFile PiperOrigin-RevId: 504863604
This commit is contained in:
parent
76eb2d4f59
commit
697f84161d
4 changed files with 17 additions and 21 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue