Test: Remove nullness for testid
This also makes it more consistent with newer testId tests that don't have nullness, so tests don't look inconsistent, and was pretty easy to do :P PiperOrigin-RevId: 616856888
This commit is contained in:
parent
1adb2b270d
commit
e446f20a70
@ -36,9 +36,7 @@ import androidx.media3.common.util.Size;
|
||||
import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -70,7 +68,7 @@ public final class AlphaScaleShaderProgramPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull AlphaScaleShaderProgram alphaScaleShaderProgram;
|
||||
@ -104,7 +102,6 @@ public final class AlphaScaleShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -118,7 +115,6 @@ public final class AlphaScaleShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void noOpAlpha_matchesGoldenFile() throws Exception {
|
||||
alphaScaleShaderProgram = new AlphaScale(1.0f).toGlShaderProgram(context, /* useHdr= */ false);
|
||||
Size outputSize = alphaScaleShaderProgram.configure(inputWidth, inputHeight);
|
||||
@ -138,7 +134,6 @@ public final class AlphaScaleShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void zeroAlpha_matchesGoldenFile() throws Exception {
|
||||
alphaScaleShaderProgram = new AlphaScale(0.0f).toGlShaderProgram(context, /* useHdr= */ false);
|
||||
Size outputSize = alphaScaleShaderProgram.configure(inputWidth, inputHeight);
|
||||
@ -157,7 +152,6 @@ public final class AlphaScaleShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void decreaseAlpha_matchesGoldenFile() throws Exception {
|
||||
alphaScaleShaderProgram = new AlphaScale(0.5f).toGlShaderProgram(context, /* useHdr= */ false);
|
||||
Size outputSize = alphaScaleShaderProgram.configure(inputWidth, inputHeight);
|
||||
@ -176,7 +170,6 @@ public final class AlphaScaleShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void increaseAlpha_matchesGoldenFile() throws Exception {
|
||||
alphaScaleShaderProgram = new AlphaScale(1.5f).toGlShaderProgram(context, /* useHdr= */ false);
|
||||
Size outputSize = alphaScaleShaderProgram.configure(inputWidth, inputHeight);
|
||||
|
@ -38,9 +38,7 @@ import androidx.media3.common.util.GlUtil;
|
||||
import androidx.media3.common.util.Size;
|
||||
import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -74,7 +72,7 @@ public class ContrastPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull EGLSurface placeholderEglSurface;
|
||||
@ -96,7 +94,6 @@ public class ContrastPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -110,7 +107,6 @@ public class ContrastPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_noContrastChange_leavesFrameUnchanged() throws Exception {
|
||||
contrastShaderProgram =
|
||||
new Contrast(/* contrast= */ 0.0f).toGlShaderProgram(context, /* useHdr= */ false);
|
||||
@ -129,7 +125,6 @@ public class ContrastPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_minimumContrast_producesAllGrayFrame() throws Exception {
|
||||
contrastShaderProgram =
|
||||
new Contrast(/* contrast= */ -1.0f).toGlShaderProgram(context, /* useHdr= */ false);
|
||||
@ -153,7 +148,6 @@ public class ContrastPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_decreaseContrast_decreasesPixelsGreaterEqual128IncreasesBelow()
|
||||
throws Exception {
|
||||
contrastShaderProgram =
|
||||
@ -173,7 +167,6 @@ public class ContrastPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_increaseContrast_increasesPixelsGreaterEqual128DecreasesBelow()
|
||||
throws Exception {
|
||||
contrastShaderProgram =
|
||||
@ -193,7 +186,6 @@ public class ContrastPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_maximumContrast_pixelEither0or255() throws Exception {
|
||||
contrastShaderProgram =
|
||||
new Contrast(/* contrast= */ 1.0f).toGlShaderProgram(context, /* useHdr= */ false);
|
||||
|
@ -36,9 +36,7 @@ import androidx.media3.common.util.Size;
|
||||
import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -67,7 +65,7 @@ public final class CropPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull BaseGlShaderProgram cropShaderProgram;
|
||||
@ -89,7 +87,6 @@ public final class CropPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -105,7 +102,6 @@ public final class CropPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_noEdits_matchesGoldenFile() throws Exception {
|
||||
cropShaderProgram =
|
||||
new Crop(/* left= */ -1, /* right= */ 1, /* bottom= */ -1, /* top= */ 1)
|
||||
@ -126,7 +122,6 @@ public final class CropPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_cropSmaller_matchesGoldenFile() throws Exception {
|
||||
cropShaderProgram =
|
||||
new Crop(/* left= */ -0.9f, /* right= */ 0.1f, /* bottom= */ -1f, /* top= */ 0.5f)
|
||||
@ -147,7 +142,6 @@ public final class CropPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_cropLarger_matchesGoldenFile() throws Exception {
|
||||
cropShaderProgram =
|
||||
new Crop(/* left= */ -2f, /* right= */ 2f, /* bottom= */ -1f, /* top= */ 2f)
|
||||
|
@ -35,9 +35,7 @@ import androidx.media3.common.util.GlUtil;
|
||||
import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -68,7 +66,7 @@ public final class DefaultShaderProgramPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull BaseGlShaderProgram defaultShaderProgram;
|
||||
@ -95,7 +93,6 @@ public final class DefaultShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -111,7 +108,6 @@ public final class DefaultShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_noEdits_matchesGoldenFile() throws Exception {
|
||||
Matrix identityMatrix = new Matrix();
|
||||
MatrixTransformation noEditsTransformation = (long presentationTimeUs) -> identityMatrix;
|
||||
@ -130,7 +126,6 @@ public final class DefaultShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_translateRight_matchesGoldenFile() throws Exception {
|
||||
Matrix translateRightMatrix = new Matrix();
|
||||
translateRightMatrix.postTranslate(/* dx= */ 1, /* dy= */ 0);
|
||||
@ -152,7 +147,6 @@ public final class DefaultShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_scaleNarrow_matchesGoldenFile() throws Exception {
|
||||
Matrix scaleNarrowMatrix = new Matrix();
|
||||
scaleNarrowMatrix.postScale(.5f, 1.2f);
|
||||
@ -173,7 +167,6 @@ public final class DefaultShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_rotate90_matchesGoldenFile() throws Exception {
|
||||
Matrix rotate90Matrix = new Matrix();
|
||||
rotate90Matrix.postRotate(/* degrees= */ 90);
|
||||
|
@ -25,9 +25,7 @@ import androidx.media3.common.C;
|
||||
import androidx.media3.common.VideoFrameProcessingException;
|
||||
import androidx.media3.test.utils.VideoFrameProcessorTestRunner;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -43,11 +41,10 @@ public class DefaultVideoFrameProcessorFlushTest {
|
||||
@Rule public final TestName testName = new TestName();
|
||||
|
||||
private int outputFrameCount;
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull VideoFrameProcessorTestRunner videoFrameProcessorTestRunner;
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull({"testId"})
|
||||
public void setUp() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -58,7 +55,6 @@ public class DefaultVideoFrameProcessorFlushTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"testId"})
|
||||
public void imageInput_flushBeforeInput_throwsException() throws Exception {
|
||||
videoFrameProcessorTestRunner = createDefaultVideoFrameProcessorTestRunner(testId);
|
||||
|
||||
@ -71,7 +67,6 @@ public class DefaultVideoFrameProcessorFlushTest {
|
||||
// behavior at all, and in practice has succeeded every time on a 1000-time run.
|
||||
// TODO: b/302695659 - Make this test more deterministic.
|
||||
@Test
|
||||
@RequiresNonNull({"testId"})
|
||||
public void imageInput_flushRightAfterInput_outputsPartialFrames() throws Exception {
|
||||
videoFrameProcessorTestRunner = createDefaultVideoFrameProcessorTestRunner(testId);
|
||||
Bitmap bitmap = readBitmapUnpremultipliedAlpha(ORIGINAL_PNG_ASSET_PATH);
|
||||
@ -91,7 +86,6 @@ public class DefaultVideoFrameProcessorFlushTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"testId"})
|
||||
public void imageInput_flushAfterAllFramesOutput_outputsAllFrames() throws Exception {
|
||||
videoFrameProcessorTestRunner = createDefaultVideoFrameProcessorTestRunner(testId);
|
||||
Bitmap bitmap = readBitmapUnpremultipliedAlpha(ORIGINAL_PNG_ASSET_PATH);
|
||||
|
@ -51,12 +51,12 @@ public class DefaultVideoFrameProcessorImageFrameOutputTest {
|
||||
private static final String BITMAP_OVERLAY_PNG_ASSET_PATH =
|
||||
"test-generated-goldens/sample_mp4_first_frame/electrical_colors/overlay_bitmap_FrameProcessor.png";
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull VideoFrameProcessorTestRunner videoFrameProcessorTestRunner;
|
||||
private @MonotonicNonNull AtomicInteger framesProduced;
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull({"framesProduced", "testId"})
|
||||
@EnsuresNonNull({"framesProduced"})
|
||||
public void setUp() {
|
||||
framesProduced = new AtomicInteger();
|
||||
testId = testName.getMethodName();
|
||||
@ -68,7 +68,7 @@ public class DefaultVideoFrameProcessorImageFrameOutputTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"framesProduced", "testId"})
|
||||
@RequiresNonNull({"framesProduced"})
|
||||
public void imageInput_queueThreeBitmaps_outputsCorrectNumberOfFrames() throws Exception {
|
||||
videoFrameProcessorTestRunner = getDefaultFrameProcessorTestRunnerBuilder(testId).build();
|
||||
|
||||
@ -94,7 +94,7 @@ public class DefaultVideoFrameProcessorImageFrameOutputTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"framesProduced", "testId"})
|
||||
@RequiresNonNull({"framesProduced"})
|
||||
public void imageInput_queueTwentyBitmaps_outputsCorrectNumberOfFrames() throws Exception {
|
||||
videoFrameProcessorTestRunner = getDefaultFrameProcessorTestRunnerBuilder(testId).build();
|
||||
|
||||
@ -112,7 +112,7 @@ public class DefaultVideoFrameProcessorImageFrameOutputTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"framesProduced", "testId"})
|
||||
@RequiresNonNull({"framesProduced"})
|
||||
public void imageInput_queueOneWithStartOffset_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||
throws Exception {
|
||||
Queue<Long> actualPresentationTimesUs = new ConcurrentLinkedQueue<>();
|
||||
@ -134,7 +134,7 @@ public class DefaultVideoFrameProcessorImageFrameOutputTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"framesProduced", "testId"})
|
||||
@RequiresNonNull({"framesProduced"})
|
||||
public void imageInput_queueWithStartOffsets_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||
throws Exception {
|
||||
Queue<Long> actualPresentationTimesUs = new ConcurrentLinkedQueue<>();
|
||||
@ -166,7 +166,7 @@ public class DefaultVideoFrameProcessorImageFrameOutputTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"framesProduced", "testId"})
|
||||
@RequiresNonNull({"framesProduced"})
|
||||
public void queueBitmapsWithTimestamps_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||
throws Exception {
|
||||
Queue<Long> actualPresentationTimesUs = new ConcurrentLinkedQueue<>();
|
||||
|
@ -33,9 +33,7 @@ import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.media3.test.utils.VideoFrameProcessorTestRunner;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -97,11 +95,10 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
private static final GlEffect NO_OP_EFFECT =
|
||||
new GlEffectWrapper(new ScaleAndRotateTransformation.Builder().build());
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull VideoFrameProcessorTestRunner videoFrameProcessorTestRunner;
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -112,7 +109,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void noEffects_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner = getDefaultFrameProcessorTestRunnerBuilder(testId).build();
|
||||
Bitmap expectedBitmap = readBitmap(ORIGINAL_PNG_ASSET_PATH);
|
||||
@ -127,7 +123,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void noEffects_withFrameCache_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
@ -145,7 +140,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void noEffects_withDisabledColorTransfers_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
@ -166,7 +160,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void noEffects_withImageInput_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner = getDefaultFrameProcessorTestRunnerBuilder(testId).build();
|
||||
Bitmap originalBitmap = readBitmap(IMAGE_JPG_ASSET_PATH);
|
||||
@ -184,7 +177,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void wrappedCrop_withImageInput_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
@ -211,7 +203,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void noOpEffect_withImageInputAndDisabledColorTransfers_matchesGoldenFile()
|
||||
throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
@ -238,7 +229,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void setPixelWidthHeightRatio_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId).setPixelWidthHeightRatio(2f).build();
|
||||
@ -254,7 +244,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void matrixTransformation_matchesGoldenFile() throws Exception {
|
||||
Matrix translateRightMatrix = new Matrix();
|
||||
translateRightMatrix.postTranslate(/* dx= */ 1, /* dy= */ 0);
|
||||
@ -274,7 +263,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void matrixAndScaleAndRotateTransformation_matchesGoldenFile() throws Exception {
|
||||
Matrix translateRightMatrix = new Matrix();
|
||||
translateRightMatrix.postTranslate(/* dx= */ 1, /* dy= */ 0);
|
||||
@ -296,7 +284,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void bitmapOverlay_matchesGoldenFile() throws Exception {
|
||||
Bitmap overlayBitmap = readBitmap(OVERLAY_PNG_ASSET_PATH);
|
||||
BitmapOverlay bitmapOverlay = BitmapOverlay.createStaticBitmapOverlay(overlayBitmap);
|
||||
@ -316,7 +303,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void scaleAndRotateAndMatrixTransformation_matchesGoldenFile() throws Exception {
|
||||
Matrix translateRightMatrix = new Matrix();
|
||||
translateRightMatrix.postTranslate(/* dx= */ 1, /* dy= */ 0);
|
||||
@ -338,7 +324,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void presentation_createForHeight_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
@ -356,7 +341,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void cropThenPresentation_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
@ -378,7 +362,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void scaleAndRotateTransformation_rotate45_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
@ -396,7 +379,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void twoWrappedScaleAndRotateTransformations_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
@ -420,7 +402,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void manyComposedMatrixEffects_matchesSingleEffect() throws Exception {
|
||||
Crop centerCrop =
|
||||
new Crop(/* left= */ -0.5f, /* right= */ 0.5f, /* bottom= */ -0.5f, /* top= */ 0.5f);
|
||||
@ -454,7 +435,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void increaseBrightness_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId).setEffects(new Brightness(0.5f)).build();
|
||||
@ -470,7 +450,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void manyComposedMatrixAndRgbEffects_producesSameOutputAsCombinedEffects()
|
||||
throws Exception {
|
||||
Crop centerCrop =
|
||||
@ -516,7 +495,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void manyComposedMatrixAndRgbEffects_withFrameCache_producesSameOutputAsCombinedEffects()
|
||||
throws Exception {
|
||||
Crop centerCrop =
|
||||
@ -563,7 +541,6 @@ public final class DefaultVideoFrameProcessorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void grayscaleThenIncreaseRedChannel_matchesGoldenFile() throws Exception {
|
||||
videoFrameProcessorTestRunner =
|
||||
getDefaultFrameProcessorTestRunnerBuilder(testId)
|
||||
|
@ -47,9 +47,9 @@ public class FrameDropTest {
|
||||
private static final String ASSET_PATH = "test-generated-goldens/FrameDropTest";
|
||||
|
||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
|
||||
@EnsuresNonNull({"textureBitmapReader", "testId"})
|
||||
@EnsuresNonNull({"textureBitmapReader"})
|
||||
@Before
|
||||
public void setUp() {
|
||||
textureBitmapReader = new TextureBitmapReader();
|
||||
@ -57,7 +57,7 @@ public class FrameDropTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"textureBitmapReader", "testId"})
|
||||
@RequiresNonNull({"textureBitmapReader"})
|
||||
public void frameDrop_withDefaultStrategy_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||
throws Exception {
|
||||
ImmutableList<Long> frameTimesUs =
|
||||
@ -73,7 +73,7 @@ public class FrameDropTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"textureBitmapReader", "testId"})
|
||||
@RequiresNonNull({"textureBitmapReader"})
|
||||
public void frameDrop_withSimpleStrategy_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||
throws Exception {
|
||||
ImmutableList<Long> frameTimesUs =
|
||||
@ -90,7 +90,7 @@ public class FrameDropTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"textureBitmapReader", "testId"})
|
||||
@RequiresNonNull({"textureBitmapReader"})
|
||||
public void frameDrop_withSimpleStrategy_outputsAllFrames() throws Exception {
|
||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(0L, 333_333L, 666_667L);
|
||||
FrameDropEffect frameDropEffect =
|
||||
|
@ -71,10 +71,10 @@ public class GaussianBlurTest {
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
};
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||
|
||||
@EnsuresNonNull({"textureBitmapReader", "testId"})
|
||||
@EnsuresNonNull({"textureBitmapReader"})
|
||||
@Before
|
||||
public void setUp() {
|
||||
textureBitmapReader = new TextureBitmapReader();
|
||||
@ -85,7 +85,7 @@ public class GaussianBlurTest {
|
||||
// different text rendering implementation that leads to a larger pixel difference.
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"textureBitmapReader", "testId"})
|
||||
@RequiresNonNull({"textureBitmapReader"})
|
||||
public void gaussianBlur_blursFrame() throws Exception {
|
||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(22_000L);
|
||||
ImmutableList<Long> actualPresentationTimesUs =
|
||||
|
@ -74,10 +74,10 @@ public class GaussianBlurWithFrameOverlaidTest {
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
};
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||
|
||||
@EnsuresNonNull({"textureBitmapReader", "testId"})
|
||||
@EnsuresNonNull({"textureBitmapReader"})
|
||||
@Before
|
||||
public void setUp() {
|
||||
textureBitmapReader = new TextureBitmapReader();
|
||||
@ -88,7 +88,7 @@ public class GaussianBlurWithFrameOverlaidTest {
|
||||
// different text rendering implementation that leads to a larger pixel difference.
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"textureBitmapReader", "testId"})
|
||||
@RequiresNonNull({"textureBitmapReader"})
|
||||
public void gaussianBlurWithFrameOverlaid_blursFrameAndOverlaysSharpImage() throws Exception {
|
||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(32_000L);
|
||||
ImmutableList<Long> actualPresentationTimesUs =
|
||||
@ -106,7 +106,7 @@ public class GaussianBlurWithFrameOverlaidTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"textureBitmapReader", "testId"})
|
||||
@RequiresNonNull({"textureBitmapReader"})
|
||||
public void gaussianBlurWithFrameOverlaid_sigmaChangesWithTime_differentFramesHaveDifferentBlurs()
|
||||
throws Exception {
|
||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(32_000L, 71_000L);
|
||||
|
@ -42,9 +42,7 @@ import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -93,7 +91,7 @@ public class OverlayShaderProgramPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull BaseGlShaderProgram overlayShaderProgram;
|
||||
@ -115,7 +113,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -129,7 +126,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_noOverlay_leavesFrameUnchanged() throws Exception {
|
||||
overlayShaderProgram =
|
||||
new OverlayEffect(/* textureOverlays= */ ImmutableList.of())
|
||||
@ -149,7 +145,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_bitmapOverlay_blendsBitmapIntoFrame() throws Exception {
|
||||
Bitmap overlayBitmap = readBitmap(OVERLAY_PNG_ASSET_PATH);
|
||||
BitmapOverlay bitmapOverlay = BitmapOverlay.createStaticBitmapOverlay(overlayBitmap);
|
||||
@ -171,7 +166,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_anchoredAndTranslatedBitmapOverlay_blendsBitmapIntoTopLeftOfFrame()
|
||||
throws Exception {
|
||||
Bitmap overlayBitmap = readBitmap(OVERLAY_PNG_ASSET_PATH);
|
||||
@ -200,7 +194,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void
|
||||
drawFrame_overlayFrameAnchoredOnlyBitmapOverlay_anchorsOverlayFromTopLeftCornerOfFrame()
|
||||
throws Exception {
|
||||
@ -227,7 +220,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_rotatedBitmapOverlay_blendsBitmapRotated90degrees() throws Exception {
|
||||
Bitmap overlayBitmap = readBitmap(OVERLAY_PNG_ASSET_PATH);
|
||||
OverlaySettings overlaySettings = new OverlaySettings.Builder().setRotationDegrees(90f).build();
|
||||
@ -251,7 +243,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_translucentBitmapOverlay_blendsBitmapIntoFrame() throws Exception {
|
||||
Bitmap bitmap = readBitmap(OVERLAY_PNG_ASSET_PATH);
|
||||
OverlaySettings overlaySettings = new OverlaySettings.Builder().setAlphaScale(0.5f).build();
|
||||
@ -275,7 +266,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_transparentTextOverlay_blendsBitmapIntoFrame() throws Exception {
|
||||
SpannableString overlayText = new SpannableString(/* source= */ "Text styling");
|
||||
OverlaySettings overlaySettings = new OverlaySettings.Builder().setAlphaScale(0f).build();
|
||||
@ -304,7 +294,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_textOverlay_blendsTextIntoFrame() throws Exception {
|
||||
SpannableString overlayText = new SpannableString(/* source= */ "Text styling");
|
||||
overlayText.setSpan(
|
||||
@ -331,7 +320,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_textOverlayWithRelativeScaleSpan_blendsTextIntoFrame() throws Exception {
|
||||
SpannableString overlayText = new SpannableString(/* source= */ "helllllloooo!!!");
|
||||
overlayText.setSpan(
|
||||
@ -358,7 +346,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_anchoredTextOverlay_blendsTextIntoTheTopRightQuadrantOfFrame()
|
||||
throws Exception {
|
||||
SpannableString overlayText = new SpannableString(/* source= */ "Text styling");
|
||||
@ -389,7 +376,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_multipleOverlays_blendsBothIntoFrame() throws Exception {
|
||||
SpannableString overlayText = new SpannableString(/* source= */ "Overlay 1");
|
||||
overlayText.setSpan(
|
||||
@ -421,7 +407,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_overlappingOverlays_blendsOnFifoOrder() throws Exception {
|
||||
SpannableString overlayText = new SpannableString(/* source= */ "Overlapping text");
|
||||
overlayText.setSpan(
|
||||
@ -455,7 +440,6 @@ public class OverlayShaderProgramPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_scaledBitmapOverlay_letterboxStretchesOverlay() throws Exception {
|
||||
Bitmap overlayBitmap = readBitmap(OVERLAY_PNG_ASSET_PATH);
|
||||
overlayShaderProgram =
|
||||
|
@ -37,9 +37,7 @@ import androidx.media3.common.util.Size;
|
||||
import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -76,7 +74,7 @@ public final class PresentationPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull BaseGlShaderProgram presentationShaderProgram;
|
||||
@ -98,7 +96,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -114,7 +111,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_noEdits_matchesGoldenFile() throws Exception {
|
||||
presentationShaderProgram =
|
||||
Presentation.createForHeight(C.LENGTH_UNSET)
|
||||
@ -135,7 +131,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_changeAspectRatio_scaleToFit_narrow_matchesGoldenFile() throws Exception {
|
||||
presentationShaderProgram =
|
||||
Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_SCALE_TO_FIT)
|
||||
@ -156,7 +151,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_changeAspectRatio_scaleToFit_wide_matchesGoldenFile() throws Exception {
|
||||
presentationShaderProgram =
|
||||
Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_SCALE_TO_FIT)
|
||||
@ -177,7 +171,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_changeAspectRatio_scaleToFitWithCrop_narrow_matchesGoldenFile()
|
||||
throws Exception {
|
||||
presentationShaderProgram =
|
||||
@ -200,7 +193,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_changeAspectRatio_scaleToFitWithCrop_wide_matchesGoldenFile()
|
||||
throws Exception {
|
||||
presentationShaderProgram =
|
||||
@ -223,7 +215,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_changeAspectRatio_stretchToFit_narrow_matchesGoldenFile() throws Exception {
|
||||
presentationShaderProgram =
|
||||
Presentation.createForAspectRatio(/* aspectRatio= */ 1f, Presentation.LAYOUT_STRETCH_TO_FIT)
|
||||
@ -244,7 +235,6 @@ public final class PresentationPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_changeAspectRatio_stretchToFit_wide_matchesGoldenFile() throws Exception {
|
||||
presentationShaderProgram =
|
||||
Presentation.createForAspectRatio(/* aspectRatio= */ 2f, Presentation.LAYOUT_STRETCH_TO_FIT)
|
||||
|
@ -40,9 +40,7 @@ import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -73,7 +71,7 @@ public final class RgbAdjustmentPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull BaseGlShaderProgram defaultShaderProgram;
|
||||
@ -106,7 +104,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -120,7 +117,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_identityMatrix_leavesFrameUnchanged() throws Exception {
|
||||
RgbMatrix identityMatrix = new RgbAdjustment.Builder().build();
|
||||
defaultShaderProgram = identityMatrix.toGlShaderProgram(context, /* useHdr= */ false);
|
||||
@ -138,7 +134,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_removeColors_producesBlackFrame() throws Exception {
|
||||
RgbMatrix removeColorMatrix =
|
||||
new RgbAdjustment.Builder().setRedScale(0).setGreenScale(0).setBlueScale(0).build();
|
||||
@ -159,7 +154,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_redOnlyFilter_removeBlueAndGreenValues() throws Exception {
|
||||
RgbMatrix redOnlyMatrix = new RgbAdjustment.Builder().setBlueScale(0).setGreenScale(0).build();
|
||||
defaultShaderProgram = redOnlyMatrix.toGlShaderProgram(context, /* useHdr= */ false);
|
||||
@ -177,7 +171,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_increaseRedChannel_producesBrighterAndRedderFrame() throws Exception {
|
||||
RgbMatrix increaseRedMatrix = new RgbAdjustment.Builder().setRedScale(5).build();
|
||||
defaultShaderProgram = increaseRedMatrix.toGlShaderProgram(context, /* useHdr= */ false);
|
||||
@ -195,7 +188,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_increaseBrightness_increasesAllValues() throws Exception {
|
||||
RgbMatrix increaseBrightnessMatrix =
|
||||
new RgbAdjustment.Builder().setRedScale(5).setGreenScale(5).setBlueScale(5).build();
|
||||
@ -214,7 +206,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_removeRedGreenAndBlueValuesInAChain_producesBlackImage() throws Exception {
|
||||
RgbMatrix noRed = new RgbAdjustment.Builder().setRedScale(0).build();
|
||||
RgbMatrix noGreen = new RgbAdjustment.Builder().setGreenScale(0).build();
|
||||
@ -241,7 +232,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_removeBlueAndGreenValuesInAChain_producesOnlyRedImage() throws Exception {
|
||||
RgbMatrix noGreen = new RgbAdjustment.Builder().setGreenScale(0).build();
|
||||
RgbMatrix noBlue = new RgbAdjustment.Builder().setBlueScale(0).build();
|
||||
@ -265,7 +255,6 @@ public final class RgbAdjustmentPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_increasesAndDecreasesRed_producesNoChange() throws Exception {
|
||||
float redScale = 4;
|
||||
RgbMatrix scaleRedMatrix = new RgbAdjustment.Builder().setRedScale(redScale).build();
|
||||
|
@ -37,9 +37,7 @@ import androidx.media3.common.util.Size;
|
||||
import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import java.io.IOException;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -68,7 +66,7 @@ public final class RgbFilterPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull BaseGlShaderProgram defaultShaderProgram;
|
||||
@ -101,7 +99,6 @@ public final class RgbFilterPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -115,7 +112,6 @@ public final class RgbFilterPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_grayscale_producesGrayscaleImage() throws Exception {
|
||||
RgbMatrix grayscaleMatrix = RgbFilter.createGrayscaleFilter();
|
||||
defaultShaderProgram = grayscaleMatrix.toGlShaderProgram(context, /* useHdr= */ false);
|
||||
@ -133,7 +129,6 @@ public final class RgbFilterPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_inverted_producesInvertedFrame() throws Exception {
|
||||
RgbMatrix invertedMatrix = RgbFilter.createInvertedFilter();
|
||||
defaultShaderProgram = invertedMatrix.toGlShaderProgram(context, /* useHdr= */ false);
|
||||
|
@ -37,9 +37,7 @@ import androidx.media3.common.util.GlUtil;
|
||||
import androidx.media3.common.util.Size;
|
||||
import androidx.media3.test.utils.BitmapPixelTestUtil;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -76,7 +74,7 @@ public class SingleColorLutPixelTest {
|
||||
|
||||
private final Context context = getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull EGLDisplay eglDisplay;
|
||||
private @MonotonicNonNull EGLContext eglContext;
|
||||
private @MonotonicNonNull EGLSurface placeholderEglSurface;
|
||||
@ -98,7 +96,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -112,7 +109,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_identityCubeLutSize2_leavesFrameUnchanged() throws Exception {
|
||||
int[][][] cubeIdentityLut = createIdentityLutCube(/* length= */ 2);
|
||||
colorLutShaderProgram =
|
||||
@ -133,7 +129,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_identityCubeLutSize64_leavesFrameUnchanged() throws Exception {
|
||||
int[][][] cubeIdentityLut = createIdentityLutCube(/* length= */ 64);
|
||||
colorLutShaderProgram =
|
||||
@ -154,7 +149,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_identityBitmapLutSize2_leavesFrameUnchanged() throws Exception {
|
||||
Bitmap bitmapLut = createIdentityLutBitmap(/* length= */ 2);
|
||||
colorLutShaderProgram =
|
||||
@ -174,7 +168,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_identityBitmapLutSize64_leavesFrameUnchanged() throws Exception {
|
||||
Bitmap bitmapLut = createIdentityLutBitmap(/* length= */ 64);
|
||||
colorLutShaderProgram =
|
||||
@ -194,7 +187,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_identityLutFromHaldImage_leavesFrameUnchanged() throws Exception {
|
||||
Bitmap bitmapLut = readBitmap(VERTICAL_HALD_IDENTITY_LUT);
|
||||
colorLutShaderProgram =
|
||||
@ -214,7 +206,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_mapWhiteToGreen_producesGreenHighlights() throws Exception {
|
||||
int length = 3;
|
||||
int[][][] mapWhiteToGreen = createIdentityLutCube(length);
|
||||
@ -237,7 +228,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_applyInvertedLut_producesInvertedFrame() throws Exception {
|
||||
Bitmap invertedLutBitmap = readBitmap(VERTICAL_HALD_INVERTED_LUT);
|
||||
colorLutShaderProgram =
|
||||
@ -258,7 +248,6 @@ public class SingleColorLutPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void drawFrame_applyGrayscaleLut_producesGrayscaleFrame() throws Exception {
|
||||
Bitmap grayscaleLutBitmap = readBitmap(VERTICAL_HALD_GRAYSCALE_LUT);
|
||||
colorLutShaderProgram =
|
||||
|
@ -47,9 +47,9 @@ public class TimestampAdjustmentTest {
|
||||
private static final String ASSET_PATH = "test-generated-goldens/TimestampAdjustmentTest";
|
||||
|
||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
|
||||
@EnsuresNonNull({"textureBitmapReader", "testId"})
|
||||
@EnsuresNonNull({"textureBitmapReader"})
|
||||
@Before
|
||||
public void setUp() {
|
||||
textureBitmapReader = new TextureBitmapReader();
|
||||
@ -57,7 +57,7 @@ public class TimestampAdjustmentTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull({"textureBitmapReader", "testId"})
|
||||
@RequiresNonNull({"textureBitmapReader"})
|
||||
public void timestampAdjustmentTest_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||
throws Exception {
|
||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(0L, 32_000L, 71_000L);
|
||||
|
@ -73,10 +73,8 @@ import java.util.Set;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
@ -109,11 +107,10 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
ImmutableList.of(
|
||||
new ScaleAndRotateTransformation.Builder().setRotationDegrees(180).build()));
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
private @MonotonicNonNull VideoCompositorTestRunner compositorTestRunner;
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull("testId")
|
||||
public void setUpTestId() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -128,7 +125,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
// Tests for alpha and frame alpha/occlusion.
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_withOneFrameFromEach_differentTimestamp_matchesExpectedBitmap()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -154,7 +150,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_withPrimaryTransparent_differentTimestamp_matchesExpectedBitmap()
|
||||
throws Exception {
|
||||
ImmutableList<ImmutableList<Effect>> inputEffectLists =
|
||||
@ -186,7 +181,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_withPrimaryOpaque_differentTimestamp_matchesExpectedBitmap()
|
||||
throws Exception {
|
||||
ImmutableList<ImmutableList<Effect>> inputEffectLists =
|
||||
@ -218,7 +212,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_withSecondaryTransparent_differentTimestamp_matchesExpectedBitmap()
|
||||
throws Exception {
|
||||
ImmutableList<ImmutableList<Effect>> inputEffectLists =
|
||||
@ -251,7 +244,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
// Tests for mixing different frame rates and timestamps.
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_withFiveFramesFromEach_matchesExpectedTimestamps()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -276,7 +268,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void composite_onePrimaryAndFiveSecondaryFrames_matchesExpectedTimestamps()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -302,7 +293,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void composite_fivePrimaryAndOneSecondaryFrames_matchesExpectedTimestamps()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -329,7 +319,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void composite_primaryDoubleSecondaryFrameRate_matchesExpectedTimestamps()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -356,7 +345,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void composite_primaryHalfSecondaryFrameRate_matchesExpectedTimestamps() throws Exception {
|
||||
compositorTestRunner =
|
||||
new VideoCompositorTestRunner(testId, useSharedExecutor, TWO_INPUT_COMPOSITOR_EFFECT_LISTS);
|
||||
@ -382,7 +370,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void composite_primaryVariableFrameRateWithOffset_matchesExpectedTimestampsAndBitmaps()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -409,7 +396,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void composite_secondaryVariableFrameRateWithOffset_matchesExpectedTimestampsAndBitmaps()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -438,7 +424,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
// Tests for "many" inputs/frames.
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_withTenFramesFromEach_matchesExpectedFrameCount()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -456,7 +441,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeFiveInputs_withFiveFramesFromEach_matchesExpectedFrameCount()
|
||||
throws Exception {
|
||||
compositorTestRunner =
|
||||
@ -480,7 +464,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
// Tests for different amounts of inputs.
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeOneInput_matchesExpectedBitmap() throws Exception {
|
||||
compositorTestRunner =
|
||||
new VideoCompositorTestRunner(
|
||||
@ -501,7 +484,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeThreeInputs_matchesExpectedBitmap() throws Exception {
|
||||
compositorTestRunner =
|
||||
new VideoCompositorTestRunner(
|
||||
@ -540,7 +522,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
// Tests for different layouts.
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_pictureInPicture_matchesExpectedBitmap() throws Exception {
|
||||
ImmutableList<ImmutableList<Effect>> inputEffectLists =
|
||||
ImmutableList.of(ImmutableList.of(), ImmutableList.of(RgbFilter.createGrayscaleFilter()));
|
||||
@ -579,7 +560,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_differentDimensions_matchesExpectedBitmap() throws Exception {
|
||||
ImmutableList<ImmutableList<Effect>> inputEffectLists =
|
||||
ImmutableList.of(
|
||||
@ -613,7 +593,6 @@ public final class DefaultVideoCompositorPixelTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void compositeTwoInputs_stacked_matchesExpectedBitmap() throws Exception {
|
||||
ImmutableList<ImmutableList<Effect>> inputEffectLists =
|
||||
ImmutableList.of(
|
||||
|
@ -53,9 +53,6 @@ import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@ -71,10 +68,9 @@ public class TransformerProgressTest {
|
||||
|
||||
private final Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull({"testId"})
|
||||
public void setUp() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
@ -86,7 +82,6 @@ public class TransformerProgressTest {
|
||||
* long enough for the test thread to collect at least two progress updates.
|
||||
*/
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
@SuppressWarnings("PreferJavaTimeOverload")
|
||||
public void getProgress_monotonicallyIncreasingUpdates() throws InterruptedException {
|
||||
AtomicBoolean completed = new AtomicBoolean();
|
||||
@ -168,7 +163,6 @@ public class TransformerProgressTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void getProgress_trimOptimizationEnabledAndApplied_givesIncreasingPercentages()
|
||||
throws Exception {
|
||||
// The trim optimization is only guaranteed to work on emulator for this file.
|
||||
@ -249,7 +243,6 @@ public class TransformerProgressTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void getProgress_trimOptimizationEnabledAndActive_returnsConsistentStates()
|
||||
throws Exception {
|
||||
// The trim optimization is only guaranteed to work on emulator for this file.
|
||||
|
@ -48,9 +48,6 @@ import androidx.media3.transformer.TransformerAndroidTestRunner;
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import org.checkerframework.checker.nullness.qual.EnsuresNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@ -69,16 +66,14 @@ public final class TransformerSequenceEffectTestWithHdr {
|
||||
|
||||
private final Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
|
||||
@Before
|
||||
@EnsuresNonNull({"testId"})
|
||||
public void setUp() {
|
||||
testId = testName.getMethodName();
|
||||
}
|
||||
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void export_withSdrThenHdr() throws Exception {
|
||||
assumeDeviceSupportsOpenGlToneMapping(
|
||||
testId, /* inputFormat= */ MP4_ASSET_720P_4_SECOND_HDR10_FORMAT);
|
||||
@ -113,7 +108,6 @@ public final class TransformerSequenceEffectTestWithHdr {
|
||||
* after already being configured for HDR output.
|
||||
*/
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void export_withHdrThenSdr_throws_whenHdrEditingSupported() throws Exception {
|
||||
assumeDeviceSupportsHdrEditing(testId, MP4_ASSET_720P_4_SECOND_HDR10_FORMAT);
|
||||
assumeFalse(
|
||||
@ -153,7 +147,6 @@ public final class TransformerSequenceEffectTestWithHdr {
|
||||
* will fallback to OpenGL tone-mapping, and configure VideoFrameProcessor for SDR output.
|
||||
*/
|
||||
@Test
|
||||
@RequiresNonNull("testId")
|
||||
public void export_withHdrThenSdr_whenHdrEditingUnsupported() throws Exception {
|
||||
assumeDeviceSupportsHdrEditing(testId, MP4_ASSET_720P_4_SECOND_HDR10_FORMAT);
|
||||
assumeDeviceSupportsOpenGlToneMapping(
|
||||
|
@ -183,7 +183,7 @@ public class EffectPlaybackTest {
|
||||
private final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
|
||||
private @MonotonicNonNull ExoPlayer player;
|
||||
private @MonotonicNonNull ImageReader outputImageReader;
|
||||
private @MonotonicNonNull String testId;
|
||||
private String testId;
|
||||
|
||||
@Before
|
||||
public void setUpTestId() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user