Test: Remove EnsuresNonNull from media3 editing tests.
nullness checks were removed a while ago from editing, so no need for them now. Bit neater to have less code to parse too. Also, removes RequiresNonNull PiperOrigin-RevId: 616887502
This commit is contained in:
parent
d2dc901b6a
commit
33a87a451c
@ -45,7 +45,6 @@ import java.util.concurrent.LinkedBlockingQueue;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
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.MonotonicNonNull;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -274,7 +273,6 @@ public final class DefaultVideoFrameProcessorVideoFrameRenderingTest {
|
|||||||
void onFrameAvailableForRendering(long presentationTimeUs);
|
void onFrameAvailableForRendering(long presentationTimeUs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EnsuresNonNull("defaultVideoFrameProcessor")
|
|
||||||
private void processFramesToEndOfStream(
|
private void processFramesToEndOfStream(
|
||||||
List<Long> inputPresentationTimesUs,
|
List<Long> inputPresentationTimesUs,
|
||||||
OnOutputFrameAvailableForRenderingListener onFrameAvailableListener,
|
OnOutputFrameAvailableForRenderingListener onFrameAvailableListener,
|
||||||
|
@ -30,9 +30,7 @@ import androidx.media3.common.util.Consumer;
|
|||||||
import androidx.media3.test.utils.TextureBitmapReader;
|
import androidx.media3.test.utils.TextureBitmapReader;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import com.google.common.collect.ImmutableList;
|
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.MonotonicNonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -49,7 +47,6 @@ public class FrameDropTest {
|
|||||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||||
private String testId;
|
private String testId;
|
||||||
|
|
||||||
@EnsuresNonNull({"textureBitmapReader"})
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
textureBitmapReader = new TextureBitmapReader();
|
textureBitmapReader = new TextureBitmapReader();
|
||||||
@ -57,7 +54,6 @@ public class FrameDropTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresNonNull({"textureBitmapReader"})
|
|
||||||
public void frameDrop_withDefaultStrategy_outputsFramesAtTheCorrectPresentationTimesUs()
|
public void frameDrop_withDefaultStrategy_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
ImmutableList<Long> frameTimesUs =
|
ImmutableList<Long> frameTimesUs =
|
||||||
@ -73,7 +69,6 @@ public class FrameDropTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresNonNull({"textureBitmapReader"})
|
|
||||||
public void frameDrop_withSimpleStrategy_outputsFramesAtTheCorrectPresentationTimesUs()
|
public void frameDrop_withSimpleStrategy_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
ImmutableList<Long> frameTimesUs =
|
ImmutableList<Long> frameTimesUs =
|
||||||
@ -90,7 +85,6 @@ public class FrameDropTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresNonNull({"textureBitmapReader"})
|
|
||||||
public void frameDrop_withSimpleStrategy_outputsAllFrames() throws Exception {
|
public void frameDrop_withSimpleStrategy_outputsAllFrames() throws Exception {
|
||||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(0L, 333_333L, 666_667L);
|
ImmutableList<Long> frameTimesUs = ImmutableList.of(0L, 333_333L, 666_667L);
|
||||||
FrameDropEffect frameDropEffect =
|
FrameDropEffect frameDropEffect =
|
||||||
|
@ -30,9 +30,7 @@ import androidx.media3.common.util.Consumer;
|
|||||||
import androidx.media3.test.utils.TextureBitmapReader;
|
import androidx.media3.test.utils.TextureBitmapReader;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import com.google.common.collect.ImmutableList;
|
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.MonotonicNonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -74,7 +72,6 @@ public class GaussianBlurTest {
|
|||||||
private String testId;
|
private String testId;
|
||||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||||
|
|
||||||
@EnsuresNonNull({"textureBitmapReader"})
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
textureBitmapReader = new TextureBitmapReader();
|
textureBitmapReader = new TextureBitmapReader();
|
||||||
@ -85,7 +82,6 @@ public class GaussianBlurTest {
|
|||||||
// different text rendering implementation that leads to a larger pixel difference.
|
// different text rendering implementation that leads to a larger pixel difference.
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresNonNull({"textureBitmapReader"})
|
|
||||||
public void gaussianBlur_blursFrame() throws Exception {
|
public void gaussianBlur_blursFrame() throws Exception {
|
||||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(22_000L);
|
ImmutableList<Long> frameTimesUs = ImmutableList.of(22_000L);
|
||||||
ImmutableList<Long> actualPresentationTimesUs =
|
ImmutableList<Long> actualPresentationTimesUs =
|
||||||
|
@ -32,9 +32,7 @@ import androidx.media3.common.util.Consumer;
|
|||||||
import androidx.media3.test.utils.TextureBitmapReader;
|
import androidx.media3.test.utils.TextureBitmapReader;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import com.google.common.collect.ImmutableList;
|
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.MonotonicNonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -77,7 +75,6 @@ public class GaussianBlurWithFrameOverlaidTest {
|
|||||||
private String testId;
|
private String testId;
|
||||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||||
|
|
||||||
@EnsuresNonNull({"textureBitmapReader"})
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
textureBitmapReader = new TextureBitmapReader();
|
textureBitmapReader = new TextureBitmapReader();
|
||||||
@ -88,7 +85,6 @@ public class GaussianBlurWithFrameOverlaidTest {
|
|||||||
// different text rendering implementation that leads to a larger pixel difference.
|
// different text rendering implementation that leads to a larger pixel difference.
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresNonNull({"textureBitmapReader"})
|
|
||||||
public void gaussianBlurWithFrameOverlaid_blursFrameAndOverlaysSharpImage() throws Exception {
|
public void gaussianBlurWithFrameOverlaid_blursFrameAndOverlaysSharpImage() throws Exception {
|
||||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(32_000L);
|
ImmutableList<Long> frameTimesUs = ImmutableList.of(32_000L);
|
||||||
ImmutableList<Long> actualPresentationTimesUs =
|
ImmutableList<Long> actualPresentationTimesUs =
|
||||||
@ -106,7 +102,6 @@ public class GaussianBlurWithFrameOverlaidTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresNonNull({"textureBitmapReader"})
|
|
||||||
public void gaussianBlurWithFrameOverlaid_sigmaChangesWithTime_differentFramesHaveDifferentBlurs()
|
public void gaussianBlurWithFrameOverlaid_sigmaChangesWithTime_differentFramesHaveDifferentBlurs()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(32_000L, 71_000L);
|
ImmutableList<Long> frameTimesUs = ImmutableList.of(32_000L, 71_000L);
|
||||||
|
@ -30,9 +30,7 @@ import androidx.media3.common.util.Consumer;
|
|||||||
import androidx.media3.test.utils.TextureBitmapReader;
|
import androidx.media3.test.utils.TextureBitmapReader;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import com.google.common.collect.ImmutableList;
|
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.MonotonicNonNull;
|
||||||
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -49,7 +47,6 @@ public class TimestampAdjustmentTest {
|
|||||||
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
private @MonotonicNonNull TextureBitmapReader textureBitmapReader;
|
||||||
private String testId;
|
private String testId;
|
||||||
|
|
||||||
@EnsuresNonNull({"textureBitmapReader"})
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
textureBitmapReader = new TextureBitmapReader();
|
textureBitmapReader = new TextureBitmapReader();
|
||||||
@ -57,7 +54,6 @@ public class TimestampAdjustmentTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@RequiresNonNull({"textureBitmapReader"})
|
|
||||||
public void timestampAdjustmentTest_outputsFramesAtTheCorrectPresentationTimesUs()
|
public void timestampAdjustmentTest_outputsFramesAtTheCorrectPresentationTimesUs()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
ImmutableList<Long> frameTimesUs = ImmutableList.of(0L, 32_000L, 71_000L);
|
ImmutableList<Long> frameTimesUs = ImmutableList.of(0L, 32_000L, 71_000L);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user