Commit 2f91c12f by olly Committed by Oliver Woodman

Drop prefix test- from test methods under v2/extensions

This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300530329
parent 2bd4d61b
...@@ -82,7 +82,7 @@ public class CastPlayerTest { ...@@ -82,7 +82,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testSetPlayWhenReady_masksRemoteState() { public void setPlayWhenReady_masksRemoteState() {
when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult);
assertThat(castPlayer.getPlayWhenReady()).isFalse(); assertThat(castPlayer.getPlayWhenReady()).isFalse();
...@@ -107,7 +107,7 @@ public class CastPlayerTest { ...@@ -107,7 +107,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testSetPlayWhenReadyMasking_updatesUponResultChange() { public void setPlayWhenReadyMasking_updatesUponResultChange() {
when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult);
assertThat(castPlayer.getPlayWhenReady()).isFalse(); assertThat(castPlayer.getPlayWhenReady()).isFalse();
...@@ -129,7 +129,7 @@ public class CastPlayerTest { ...@@ -129,7 +129,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testSetPlayWhenReady_correctChangeReasonOnPause() { public void setPlayWhenReady_correctChangeReasonOnPause() {
when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.play()).thenReturn(mockPendingResult);
when(mockRemoteMediaClient.pause()).thenReturn(mockPendingResult); when(mockRemoteMediaClient.pause()).thenReturn(mockPendingResult);
castPlayer.play(); castPlayer.play();
...@@ -147,7 +147,7 @@ public class CastPlayerTest { ...@@ -147,7 +147,7 @@ public class CastPlayerTest {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@Test @Test
public void testPlayWhenReady_changesOnStatusUpdates() { public void playWhenReady_changesOnStatusUpdates() {
assertThat(castPlayer.getPlayWhenReady()).isFalse(); assertThat(castPlayer.getPlayWhenReady()).isFalse();
when(mockRemoteMediaClient.isPaused()).thenReturn(false); when(mockRemoteMediaClient.isPaused()).thenReturn(false);
remoteMediaClientListener.onStatusUpdated(); remoteMediaClientListener.onStatusUpdated();
...@@ -157,7 +157,7 @@ public class CastPlayerTest { ...@@ -157,7 +157,7 @@ public class CastPlayerTest {
} }
@Test @Test
public void testSetRepeatMode_masksRemoteState() { public void setRepeatMode_masksRemoteState() {
when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult); when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult);
assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF); assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF);
...@@ -180,7 +180,7 @@ public class CastPlayerTest { ...@@ -180,7 +180,7 @@ public class CastPlayerTest {
} }
@Test @Test
public void testSetRepeatMode_updatesUponResultChange() { public void setRepeatMode_updatesUponResultChange() {
when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult); when(mockRemoteMediaClient.queueSetRepeatMode(anyInt(), any())).thenReturn(mockPendingResult);
castPlayer.setRepeatMode(Player.REPEAT_MODE_ONE); castPlayer.setRepeatMode(Player.REPEAT_MODE_ONE);
...@@ -202,7 +202,7 @@ public class CastPlayerTest { ...@@ -202,7 +202,7 @@ public class CastPlayerTest {
} }
@Test @Test
public void testRepeatMode_changesOnStatusUpdates() { public void repeatMode_changesOnStatusUpdates() {
assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF); assertThat(castPlayer.getRepeatMode()).isEqualTo(Player.REPEAT_MODE_OFF);
when(mockMediaStatus.getQueueRepeatMode()).thenReturn(MediaStatus.REPEAT_MODE_REPEAT_SINGLE); when(mockMediaStatus.getQueueRepeatMode()).thenReturn(MediaStatus.REPEAT_MODE_REPEAT_SINGLE);
remoteMediaClientListener.onStatusUpdated(); remoteMediaClientListener.onStatusUpdated();
......
...@@ -39,7 +39,7 @@ public class CastTimelineTrackerTest { ...@@ -39,7 +39,7 @@ public class CastTimelineTrackerTest {
/** Tests that duration of the current media info is correctly propagated to the timeline. */ /** Tests that duration of the current media info is correctly propagated to the timeline. */
@Test @Test
public void testGetCastTimelinePersistsDuration() { public void getCastTimelinePersistsDuration() {
CastTimelineTracker tracker = new CastTimelineTracker(); CastTimelineTracker tracker = new CastTimelineTracker();
RemoteMediaClient remoteMediaClient = RemoteMediaClient remoteMediaClient =
......
...@@ -48,18 +48,18 @@ public final class ByteArrayUploadDataProviderTest { ...@@ -48,18 +48,18 @@ public final class ByteArrayUploadDataProviderTest {
} }
@Test @Test
public void testGetLength() { public void getLength() {
assertThat(byteArrayUploadDataProvider.getLength()).isEqualTo(TEST_DATA.length); assertThat(byteArrayUploadDataProvider.getLength()).isEqualTo(TEST_DATA.length);
} }
@Test @Test
public void testReadFullBuffer() throws IOException { public void readFullBuffer() throws IOException {
byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer); byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer);
assertThat(byteBuffer.array()).isEqualTo(TEST_DATA); assertThat(byteBuffer.array()).isEqualTo(TEST_DATA);
} }
@Test @Test
public void testReadPartialBuffer() throws IOException { public void readPartialBuffer() throws IOException {
byte[] firstHalf = Arrays.copyOf(TEST_DATA, TEST_DATA.length / 2); byte[] firstHalf = Arrays.copyOf(TEST_DATA, TEST_DATA.length / 2);
byte[] secondHalf = Arrays.copyOfRange(TEST_DATA, TEST_DATA.length / 2, TEST_DATA.length); byte[] secondHalf = Arrays.copyOfRange(TEST_DATA, TEST_DATA.length / 2, TEST_DATA.length);
byteBuffer = ByteBuffer.allocate(TEST_DATA.length / 2); byteBuffer = ByteBuffer.allocate(TEST_DATA.length / 2);
...@@ -75,7 +75,7 @@ public final class ByteArrayUploadDataProviderTest { ...@@ -75,7 +75,7 @@ public final class ByteArrayUploadDataProviderTest {
} }
@Test @Test
public void testRewind() throws IOException { public void rewind() throws IOException {
// Read all the data. // Read all the data.
byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer); byteArrayUploadDataProvider.read(mockUploadDataSink, byteBuffer);
assertThat(byteBuffer.array()).isEqualTo(TEST_DATA); assertThat(byteBuffer.array()).isEqualTo(TEST_DATA);
......
...@@ -158,7 +158,7 @@ public final class CronetDataSourceTest { ...@@ -158,7 +158,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testOpeningTwiceThrows() throws HttpDataSourceException { public void openingTwiceThrows() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
dataSourceUnderTest.open(testDataSpec); dataSourceUnderTest.open(testDataSpec);
try { try {
...@@ -170,7 +170,7 @@ public final class CronetDataSourceTest { ...@@ -170,7 +170,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testCallbackFromPreviousRequest() throws HttpDataSourceException { public void callbackFromPreviousRequest() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
dataSourceUnderTest.open(testDataSpec); dataSourceUnderTest.open(testDataSpec);
...@@ -193,7 +193,7 @@ public final class CronetDataSourceTest { ...@@ -193,7 +193,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestStartCalled() throws HttpDataSourceException { public void requestStartCalled() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
dataSourceUnderTest.open(testDataSpec); dataSourceUnderTest.open(testDataSpec);
...@@ -203,7 +203,7 @@ public final class CronetDataSourceTest { ...@@ -203,7 +203,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestSetsRangeHeader() throws HttpDataSourceException { public void requestSetsRangeHeader() throws HttpDataSourceException {
testDataSpec = new DataSpec(Uri.parse(TEST_URL), 1000, 5000); testDataSpec = new DataSpec(Uri.parse(TEST_URL), 1000, 5000);
mockResponseStartSuccess(); mockResponseStartSuccess();
...@@ -213,7 +213,7 @@ public final class CronetDataSourceTest { ...@@ -213,7 +213,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestHeadersSet() throws HttpDataSourceException { public void requestHeadersSet() throws HttpDataSourceException {
Map<String, String> headersSet = new HashMap<>(); Map<String, String> headersSet = new HashMap<>();
doAnswer( doAnswer(
(invocation) -> { (invocation) -> {
...@@ -256,7 +256,7 @@ public final class CronetDataSourceTest { ...@@ -256,7 +256,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestOpen() throws HttpDataSourceException { public void requestOpen() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
assertThat(dataSourceUnderTest.open(testDataSpec)).isEqualTo(TEST_CONTENT_LENGTH); assertThat(dataSourceUnderTest.open(testDataSpec)).isEqualTo(TEST_CONTENT_LENGTH);
verify(mockTransferListener) verify(mockTransferListener)
...@@ -264,8 +264,7 @@ public final class CronetDataSourceTest { ...@@ -264,8 +264,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestOpenGzippedCompressedReturnsDataSpecLength() public void requestOpenGzippedCompressedReturnsDataSpecLength() throws HttpDataSourceException {
throws HttpDataSourceException {
testDataSpec = new DataSpec(Uri.parse(TEST_URL), 0, 5000); testDataSpec = new DataSpec(Uri.parse(TEST_URL), 0, 5000);
testResponseHeader.put("Content-Encoding", "gzip"); testResponseHeader.put("Content-Encoding", "gzip");
testResponseHeader.put("Content-Length", Long.toString(50L)); testResponseHeader.put("Content-Length", Long.toString(50L));
...@@ -277,7 +276,7 @@ public final class CronetDataSourceTest { ...@@ -277,7 +276,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestOpenFail() { public void requestOpenFail() {
mockResponseStartFailure(); mockResponseStartFailure();
try { try {
...@@ -313,7 +312,7 @@ public final class CronetDataSourceTest { ...@@ -313,7 +312,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestOpenFailDueToDnsFailure() { public void requestOpenFailDueToDnsFailure() {
mockResponseStartFailure(); mockResponseStartFailure();
when(mockNetworkException.getErrorCode()) when(mockNetworkException.getErrorCode())
.thenReturn(NetworkException.ERROR_HOSTNAME_NOT_RESOLVED); .thenReturn(NetworkException.ERROR_HOSTNAME_NOT_RESOLVED);
...@@ -331,7 +330,7 @@ public final class CronetDataSourceTest { ...@@ -331,7 +330,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestOpenValidatesStatusCode() { public void requestOpenValidatesStatusCode() {
mockResponseStartSuccess(); mockResponseStartSuccess();
testUrlResponseInfo = createUrlResponseInfo(500); // statusCode testUrlResponseInfo = createUrlResponseInfo(500); // statusCode
...@@ -348,7 +347,7 @@ public final class CronetDataSourceTest { ...@@ -348,7 +347,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestOpenValidatesContentTypePredicate() { public void requestOpenValidatesContentTypePredicate() {
mockResponseStartSuccess(); mockResponseStartSuccess();
ArrayList<String> testedContentTypes = new ArrayList<>(); ArrayList<String> testedContentTypes = new ArrayList<>();
...@@ -371,7 +370,7 @@ public final class CronetDataSourceTest { ...@@ -371,7 +370,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testPostRequestOpen() throws HttpDataSourceException { public void postRequestOpen() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
dataSourceUnderTest.setRequestProperty("Content-Type", TEST_CONTENT_TYPE); dataSourceUnderTest.setRequestProperty("Content-Type", TEST_CONTENT_TYPE);
...@@ -381,7 +380,7 @@ public final class CronetDataSourceTest { ...@@ -381,7 +380,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testPostRequestOpenValidatesContentType() { public void postRequestOpenValidatesContentType() {
mockResponseStartSuccess(); mockResponseStartSuccess();
try { try {
...@@ -393,7 +392,7 @@ public final class CronetDataSourceTest { ...@@ -393,7 +392,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testPostRequestOpenRejects307Redirects() { public void postRequestOpenRejects307Redirects() {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockResponseStartRedirect(); mockResponseStartRedirect();
...@@ -407,7 +406,7 @@ public final class CronetDataSourceTest { ...@@ -407,7 +406,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testHeadRequestOpen() throws HttpDataSourceException { public void headRequestOpen() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
dataSourceUnderTest.open(testHeadDataSpec); dataSourceUnderTest.open(testHeadDataSpec);
verify(mockTransferListener) verify(mockTransferListener)
...@@ -416,7 +415,7 @@ public final class CronetDataSourceTest { ...@@ -416,7 +415,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestReadTwice() throws HttpDataSourceException { public void requestReadTwice() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -439,7 +438,7 @@ public final class CronetDataSourceTest { ...@@ -439,7 +438,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testSecondRequestNoContentLength() throws HttpDataSourceException { public void secondRequestNoContentLength() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
testResponseHeader.put("Content-Length", Long.toString(1L)); testResponseHeader.put("Content-Length", Long.toString(1L));
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -465,7 +464,7 @@ public final class CronetDataSourceTest { ...@@ -465,7 +464,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadWithOffset() throws HttpDataSourceException { public void readWithOffset() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -480,7 +479,7 @@ public final class CronetDataSourceTest { ...@@ -480,7 +479,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRangeRequestWith206Response() throws HttpDataSourceException { public void rangeRequestWith206Response() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(1000, 5000); mockReadSuccess(1000, 5000);
testUrlResponseInfo = createUrlResponseInfo(206); // Server supports range requests. testUrlResponseInfo = createUrlResponseInfo(206); // Server supports range requests.
...@@ -497,7 +496,7 @@ public final class CronetDataSourceTest { ...@@ -497,7 +496,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRangeRequestWith200Response() throws HttpDataSourceException { public void rangeRequestWith200Response() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 7000); mockReadSuccess(0, 7000);
testUrlResponseInfo = createUrlResponseInfo(200); // Server does not support range requests. testUrlResponseInfo = createUrlResponseInfo(200); // Server does not support range requests.
...@@ -514,7 +513,7 @@ public final class CronetDataSourceTest { ...@@ -514,7 +513,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadWithUnsetLength() throws HttpDataSourceException { public void readWithUnsetLength() throws HttpDataSourceException {
testResponseHeader.remove("Content-Length"); testResponseHeader.remove("Content-Length");
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -530,7 +529,7 @@ public final class CronetDataSourceTest { ...@@ -530,7 +529,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadReturnsWhatItCan() throws HttpDataSourceException { public void readReturnsWhatItCan() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -545,7 +544,7 @@ public final class CronetDataSourceTest { ...@@ -545,7 +544,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testClosedMeansClosed() throws HttpDataSourceException { public void closedMeansClosed() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -573,7 +572,7 @@ public final class CronetDataSourceTest { ...@@ -573,7 +572,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testOverread() throws HttpDataSourceException { public void overread() throws HttpDataSourceException {
testDataSpec = new DataSpec(Uri.parse(TEST_URL), 0, 16); testDataSpec = new DataSpec(Uri.parse(TEST_URL), 0, 16);
testResponseHeader.put("Content-Length", Long.toString(16L)); testResponseHeader.put("Content-Length", Long.toString(16L));
mockResponseStartSuccess(); mockResponseStartSuccess();
...@@ -626,7 +625,7 @@ public final class CronetDataSourceTest { ...@@ -626,7 +625,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestReadByteBufferTwice() throws HttpDataSourceException { public void requestReadByteBufferTwice() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -652,7 +651,7 @@ public final class CronetDataSourceTest { ...@@ -652,7 +651,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRequestIntermixRead() throws HttpDataSourceException { public void requestIntermixRead() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
// Chunking reads into parts 6, 7, 8, 9. // Chunking reads into parts 6, 7, 8, 9.
mockReadSuccess(0, 30); mockReadSuccess(0, 30);
...@@ -694,7 +693,7 @@ public final class CronetDataSourceTest { ...@@ -694,7 +693,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testSecondRequestNoContentLengthReadByteBuffer() throws HttpDataSourceException { public void secondRequestNoContentLengthReadByteBuffer() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
testResponseHeader.put("Content-Length", Long.toString(1L)); testResponseHeader.put("Content-Length", Long.toString(1L));
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -723,7 +722,7 @@ public final class CronetDataSourceTest { ...@@ -723,7 +722,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRangeRequestWith206ResponseReadByteBuffer() throws HttpDataSourceException { public void rangeRequestWith206ResponseReadByteBuffer() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(1000, 5000); mockReadSuccess(1000, 5000);
testUrlResponseInfo = createUrlResponseInfo(206); // Server supports range requests. testUrlResponseInfo = createUrlResponseInfo(206); // Server supports range requests.
...@@ -741,7 +740,7 @@ public final class CronetDataSourceTest { ...@@ -741,7 +740,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRangeRequestWith200ResponseReadByteBuffer() throws HttpDataSourceException { public void rangeRequestWith200ResponseReadByteBuffer() throws HttpDataSourceException {
// Tests for skipping bytes. // Tests for skipping bytes.
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 7000); mockReadSuccess(0, 7000);
...@@ -760,7 +759,7 @@ public final class CronetDataSourceTest { ...@@ -760,7 +759,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadByteBufferWithUnsetLength() throws HttpDataSourceException { public void readByteBufferWithUnsetLength() throws HttpDataSourceException {
testResponseHeader.remove("Content-Length"); testResponseHeader.remove("Content-Length");
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -778,7 +777,7 @@ public final class CronetDataSourceTest { ...@@ -778,7 +777,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadByteBufferReturnsWhatItCan() throws HttpDataSourceException { public void readByteBufferReturnsWhatItCan() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -794,7 +793,7 @@ public final class CronetDataSourceTest { ...@@ -794,7 +793,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testOverreadByteBuffer() throws HttpDataSourceException { public void overreadByteBuffer() throws HttpDataSourceException {
testDataSpec = new DataSpec(Uri.parse(TEST_URL), 0, 16); testDataSpec = new DataSpec(Uri.parse(TEST_URL), 0, 16);
testResponseHeader.put("Content-Length", Long.toString(16L)); testResponseHeader.put("Content-Length", Long.toString(16L));
mockResponseStartSuccess(); mockResponseStartSuccess();
...@@ -850,7 +849,7 @@ public final class CronetDataSourceTest { ...@@ -850,7 +849,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testClosedMeansClosedReadByteBuffer() throws HttpDataSourceException { public void closedMeansClosedReadByteBuffer() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadSuccess(0, 16); mockReadSuccess(0, 16);
...@@ -880,7 +879,7 @@ public final class CronetDataSourceTest { ...@@ -880,7 +879,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testConnectTimeout() throws InterruptedException { public void connectTimeout() throws InterruptedException {
long startTimeMs = SystemClock.elapsedRealtime(); long startTimeMs = SystemClock.elapsedRealtime();
final ConditionVariable startCondition = buildUrlRequestStartedCondition(); final ConditionVariable startCondition = buildUrlRequestStartedCondition();
final CountDownLatch timedOutLatch = new CountDownLatch(1); final CountDownLatch timedOutLatch = new CountDownLatch(1);
...@@ -919,7 +918,7 @@ public final class CronetDataSourceTest { ...@@ -919,7 +918,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testConnectInterrupted() throws InterruptedException { public void connectInterrupted() throws InterruptedException {
long startTimeMs = SystemClock.elapsedRealtime(); long startTimeMs = SystemClock.elapsedRealtime();
final ConditionVariable startCondition = buildUrlRequestStartedCondition(); final ConditionVariable startCondition = buildUrlRequestStartedCondition();
final CountDownLatch timedOutLatch = new CountDownLatch(1); final CountDownLatch timedOutLatch = new CountDownLatch(1);
...@@ -959,7 +958,7 @@ public final class CronetDataSourceTest { ...@@ -959,7 +958,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testConnectResponseBeforeTimeout() throws Exception { public void connectResponseBeforeTimeout() throws Exception {
long startTimeMs = SystemClock.elapsedRealtime(); long startTimeMs = SystemClock.elapsedRealtime();
final ConditionVariable startCondition = buildUrlRequestStartedCondition(); final ConditionVariable startCondition = buildUrlRequestStartedCondition();
final CountDownLatch openLatch = new CountDownLatch(1); final CountDownLatch openLatch = new CountDownLatch(1);
...@@ -992,7 +991,7 @@ public final class CronetDataSourceTest { ...@@ -992,7 +991,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRedirectIncreasesConnectionTimeout() throws Exception { public void redirectIncreasesConnectionTimeout() throws Exception {
long startTimeMs = SystemClock.elapsedRealtime(); long startTimeMs = SystemClock.elapsedRealtime();
final ConditionVariable startCondition = buildUrlRequestStartedCondition(); final ConditionVariable startCondition = buildUrlRequestStartedCondition();
final CountDownLatch timedOutLatch = new CountDownLatch(1); final CountDownLatch timedOutLatch = new CountDownLatch(1);
...@@ -1047,7 +1046,7 @@ public final class CronetDataSourceTest { ...@@ -1047,7 +1046,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRedirectParseAndAttachCookie_dataSourceDoesNotHandleSetCookie_followsRedirect() public void redirectParseAndAttachCookie_dataSourceDoesNotHandleSetCookie_followsRedirect()
throws HttpDataSourceException { throws HttpDataSourceException {
mockSingleRedirectSuccess(); mockSingleRedirectSuccess();
mockFollowRedirectSuccess(); mockFollowRedirectSuccess();
...@@ -1119,7 +1118,7 @@ public final class CronetDataSourceTest { ...@@ -1119,7 +1118,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRedirectNoSetCookieFollowsRedirect() throws HttpDataSourceException { public void redirectNoSetCookieFollowsRedirect() throws HttpDataSourceException {
mockSingleRedirectSuccess(); mockSingleRedirectSuccess();
mockFollowRedirectSuccess(); mockFollowRedirectSuccess();
...@@ -1129,7 +1128,7 @@ public final class CronetDataSourceTest { ...@@ -1129,7 +1128,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testRedirectNoSetCookieFollowsRedirect_dataSourceHandlesSetCookie() public void redirectNoSetCookieFollowsRedirect_dataSourceHandlesSetCookie()
throws HttpDataSourceException { throws HttpDataSourceException {
dataSourceUnderTest = dataSourceUnderTest =
new CronetDataSource( new CronetDataSource(
...@@ -1151,7 +1150,7 @@ public final class CronetDataSourceTest { ...@@ -1151,7 +1150,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testExceptionFromTransferListener() throws HttpDataSourceException { public void exceptionFromTransferListener() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
// Make mockTransferListener throw an exception in CronetDataSource.close(). Ensure that // Make mockTransferListener throw an exception in CronetDataSource.close(). Ensure that
...@@ -1171,7 +1170,7 @@ public final class CronetDataSourceTest { ...@@ -1171,7 +1170,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadFailure() throws HttpDataSourceException { public void readFailure() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadFailure(); mockReadFailure();
...@@ -1186,7 +1185,7 @@ public final class CronetDataSourceTest { ...@@ -1186,7 +1185,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadByteBufferFailure() throws HttpDataSourceException { public void readByteBufferFailure() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadFailure(); mockReadFailure();
...@@ -1201,7 +1200,7 @@ public final class CronetDataSourceTest { ...@@ -1201,7 +1200,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadNonDirectedByteBufferFailure() throws HttpDataSourceException { public void readNonDirectedByteBufferFailure() throws HttpDataSourceException {
mockResponseStartSuccess(); mockResponseStartSuccess();
mockReadFailure(); mockReadFailure();
...@@ -1216,7 +1215,7 @@ public final class CronetDataSourceTest { ...@@ -1216,7 +1215,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadInterrupted() throws HttpDataSourceException, InterruptedException { public void readInterrupted() throws HttpDataSourceException, InterruptedException {
mockResponseStartSuccess(); mockResponseStartSuccess();
dataSourceUnderTest.open(testDataSpec); dataSourceUnderTest.open(testDataSpec);
...@@ -1247,7 +1246,7 @@ public final class CronetDataSourceTest { ...@@ -1247,7 +1246,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testReadByteBufferInterrupted() throws HttpDataSourceException, InterruptedException { public void readByteBufferInterrupted() throws HttpDataSourceException, InterruptedException {
mockResponseStartSuccess(); mockResponseStartSuccess();
dataSourceUnderTest.open(testDataSpec); dataSourceUnderTest.open(testDataSpec);
...@@ -1278,7 +1277,7 @@ public final class CronetDataSourceTest { ...@@ -1278,7 +1277,7 @@ public final class CronetDataSourceTest {
} }
@Test @Test
public void testAllowDirectExecutor() throws HttpDataSourceException { public void allowDirectExecutor() throws HttpDataSourceException {
testDataSpec = new DataSpec(Uri.parse(TEST_URL), 1000, 5000); testDataSpec = new DataSpec(Uri.parse(TEST_URL), 1000, 5000);
mockResponseStartSuccess(); mockResponseStartSuccess();
......
...@@ -36,7 +36,7 @@ public class FlacExtractorTest { ...@@ -36,7 +36,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSample() throws Exception { public void sample() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear.flac", /* file= */ "flac/bear.flac",
...@@ -45,7 +45,7 @@ public class FlacExtractorTest { ...@@ -45,7 +45,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithId3HeaderAndId3Enabled() throws Exception { public void sampleWithId3HeaderAndId3Enabled() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_with_id3.flac", /* file= */ "flac/bear_with_id3.flac",
...@@ -54,7 +54,7 @@ public class FlacExtractorTest { ...@@ -54,7 +54,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithId3HeaderAndId3Disabled() throws Exception { public void sampleWithId3HeaderAndId3Disabled() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
() -> new FlacExtractor(FlacExtractor.FLAG_DISABLE_ID3_METADATA), () -> new FlacExtractor(FlacExtractor.FLAG_DISABLE_ID3_METADATA),
/* file= */ "flac/bear_with_id3.flac", /* file= */ "flac/bear_with_id3.flac",
...@@ -63,7 +63,7 @@ public class FlacExtractorTest { ...@@ -63,7 +63,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleUnseekable() throws Exception { public void sampleUnseekable() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_no_seek_table_no_num_samples.flac", /* file= */ "flac/bear_no_seek_table_no_num_samples.flac",
...@@ -72,7 +72,7 @@ public class FlacExtractorTest { ...@@ -72,7 +72,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithVorbisComments() throws Exception { public void sampleWithVorbisComments() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_with_vorbis_comments.flac", /* file= */ "flac/bear_with_vorbis_comments.flac",
...@@ -81,7 +81,7 @@ public class FlacExtractorTest { ...@@ -81,7 +81,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testSampleWithPicture() throws Exception { public void sampleWithPicture() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_with_picture.flac", /* file= */ "flac/bear_with_picture.flac",
...@@ -90,7 +90,7 @@ public class FlacExtractorTest { ...@@ -90,7 +90,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testOneMetadataBlock() throws Exception { public void oneMetadataBlock() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_one_metadata_block.flac", /* file= */ "flac/bear_one_metadata_block.flac",
...@@ -99,7 +99,7 @@ public class FlacExtractorTest { ...@@ -99,7 +99,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testNoMinMaxFrameSize() throws Exception { public void noMinMaxFrameSize() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_no_min_max_frame_size.flac", /* file= */ "flac/bear_no_min_max_frame_size.flac",
...@@ -108,7 +108,7 @@ public class FlacExtractorTest { ...@@ -108,7 +108,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testNoNumSamples() throws Exception { public void noNumSamples() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_no_num_samples.flac", /* file= */ "flac/bear_no_num_samples.flac",
...@@ -117,7 +117,7 @@ public class FlacExtractorTest { ...@@ -117,7 +117,7 @@ public class FlacExtractorTest {
} }
@Test @Test
public void testUncommonSampleRate() throws Exception { public void uncommonSampleRate() throws Exception {
ExtractorAsserts.assertBehavior( ExtractorAsserts.assertBehavior(
FlacExtractor::new, FlacExtractor::new,
/* file= */ "flac/bear_uncommon_sample_rate.flac", /* file= */ "flac/bear_uncommon_sample_rate.flac",
......
...@@ -126,7 +126,7 @@ public class ImaAdsLoaderTest { ...@@ -126,7 +126,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testBuilder_overridesPlayerType() { public void builder_overridesPlayerType() {
when(imaSdkSettings.getPlayerType()).thenReturn("test player type"); when(imaSdkSettings.getPlayerType()).thenReturn("test player type");
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
...@@ -134,7 +134,7 @@ public class ImaAdsLoaderTest { ...@@ -134,7 +134,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStart_setsAdUiViewGroup() { public void start_setsAdUiViewGroup() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -143,7 +143,7 @@ public class ImaAdsLoaderTest { ...@@ -143,7 +143,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStart_withPlaceholderContent_initializedAdsLoader() { public void start_withPlaceholderContent_initializedAdsLoader() {
Timeline placeholderTimeline = new DummyTimeline(/* tag= */ null); Timeline placeholderTimeline = new DummyTimeline(/* tag= */ null);
setupPlayback(placeholderTimeline, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(placeholderTimeline, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -153,7 +153,7 @@ public class ImaAdsLoaderTest { ...@@ -153,7 +153,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStart_updatesAdPlaybackState() { public void start_updatesAdPlaybackState() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -165,14 +165,14 @@ public class ImaAdsLoaderTest { ...@@ -165,14 +165,14 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStartAfterRelease() { public void startAfterRelease() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.release(); imaAdsLoader.release();
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
} }
@Test @Test
public void testStartAndCallbacksAfterRelease() { public void startAndCallbacksAfterRelease() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.release(); imaAdsLoader.release();
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
...@@ -199,7 +199,7 @@ public class ImaAdsLoaderTest { ...@@ -199,7 +199,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testPlayback_withPrerollAd_marksAdAsPlayed() { public void playback_withPrerollAd_marksAdAsPlayed() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
// Load the preroll ad. // Load the preroll ad.
...@@ -239,7 +239,7 @@ public class ImaAdsLoaderTest { ...@@ -239,7 +239,7 @@ public class ImaAdsLoaderTest {
} }
@Test @Test
public void testStop_unregistersAllVideoControlOverlays() { public void stop_unregistersAllVideoControlOverlays() {
setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS); setupPlayback(CONTENT_TIMELINE, PREROLL_ADS_DURATIONS_US, PREROLL_CUE_POINTS_SECONDS);
imaAdsLoader.start(adsLoaderListener, adViewProvider); imaAdsLoader.start(adsLoaderListener, adViewProvider);
imaAdsLoader.requestAds(adViewGroup); imaAdsLoader.requestAds(adViewGroup);
......
...@@ -48,7 +48,7 @@ public class OpusPlaybackTest { ...@@ -48,7 +48,7 @@ public class OpusPlaybackTest {
} }
@Test @Test
public void testBasicPlayback() throws Exception { public void basicPlayback() throws Exception {
playUri(BEAR_OPUS_URI); playUri(BEAR_OPUS_URI);
} }
......
...@@ -57,12 +57,12 @@ public class VpxPlaybackTest { ...@@ -57,12 +57,12 @@ public class VpxPlaybackTest {
} }
@Test @Test
public void testBasicPlayback() throws Exception { public void basicPlayback() throws Exception {
playUri(BEAR_URI); playUri(BEAR_URI);
} }
@Test @Test
public void testOddDimensionsPlayback() throws Exception { public void oddDimensionsPlayback() throws Exception {
playUri(BEAR_ODD_DIMENSIONS_URI); playUri(BEAR_ODD_DIMENSIONS_URI);
} }
...@@ -77,7 +77,7 @@ public class VpxPlaybackTest { ...@@ -77,7 +77,7 @@ public class VpxPlaybackTest {
} }
@Test @Test
public void testInvalidBitstream() { public void invalidBitstream() {
try { try {
playUri(INVALID_BITSTREAM_URI); playUri(INVALID_BITSTREAM_URI);
fail(); fail();
......
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