Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
27b06e9a
authored
Dec 16, 2019
by
andrewlewis
Committed by
Oliver Woodman
Jan 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix ParameterName warnings in core tests
PiperOrigin-RevId: 285716982
parent
80e3152e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
19 deletions
library/core/src/test/java/com/google/android/exoplayer2/MediaPeriodQueueTest.java
library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java
library/core/src/test/java/com/google/android/exoplayer2/source/SampleQueueTest.java
library/core/src/test/java/com/google/android/exoplayer2/MediaPeriodQueueTest.java
View file @
27b06e9a
...
@@ -81,7 +81,7 @@ public final class MediaPeriodQueueTest {
...
@@ -81,7 +81,7 @@ public final class MediaPeriodQueueTest {
@Test
@Test
public
void
getNextMediaPeriodInfo_withPrerollAd_returnsCorrectMediaPeriodInfos
()
{
public
void
getNextMediaPeriodInfo_withPrerollAd_returnsCorrectMediaPeriodInfos
()
{
setupTimeline
(
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
0
);
setupTimeline
(
/* initialPositionUs= */
0
,
/* adGroupTimesUs
...
= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
assertNextMediaPeriodInfoIsAd
(
/* adGroupIndex= */
0
,
/* contentPositionUs= */
0
);
assertNextMediaPeriodInfoIsAd
(
/* adGroupIndex= */
0
,
/* contentPositionUs= */
0
);
advance
();
advance
();
...
@@ -97,7 +97,7 @@ public final class MediaPeriodQueueTest {
...
@@ -97,7 +97,7 @@ public final class MediaPeriodQueueTest {
public
void
getNextMediaPeriodInfo_withMidrollAds_returnsCorrectMediaPeriodInfos
()
{
public
void
getNextMediaPeriodInfo_withMidrollAds_returnsCorrectMediaPeriodInfos
()
{
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
);
SECOND_AD_START_TIME_US
);
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod
(
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod
(
/* startPositionUs= */
0
,
/* startPositionUs= */
0
,
...
@@ -135,7 +135,7 @@ public final class MediaPeriodQueueTest {
...
@@ -135,7 +135,7 @@ public final class MediaPeriodQueueTest {
public
void
getNextMediaPeriodInfo_withMidrollAndPostroll_returnsCorrectMediaPeriodInfos
()
{
public
void
getNextMediaPeriodInfo_withMidrollAndPostroll_returnsCorrectMediaPeriodInfos
()
{
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
C
.
TIME_END_OF_SOURCE
);
C
.
TIME_END_OF_SOURCE
);
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod
(
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod
(
/* startPositionUs= */
0
,
/* startPositionUs= */
0
,
...
@@ -169,7 +169,7 @@ public final class MediaPeriodQueueTest {
...
@@ -169,7 +169,7 @@ public final class MediaPeriodQueueTest {
@Test
@Test
public
void
getNextMediaPeriodInfo_withPostrollLoadError_returnsEmptyFinalMediaPeriodInfo
()
{
public
void
getNextMediaPeriodInfo_withPostrollLoadError_returnsEmptyFinalMediaPeriodInfo
()
{
setupTimeline
(
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
C
.
TIME_END_OF_SOURCE
);
setupTimeline
(
/* initialPositionUs= */
0
,
/* adGroupTimesUs
...
= */
C
.
TIME_END_OF_SOURCE
);
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod
(
assertGetNextMediaPeriodInfoReturnsContentMediaPeriod
(
/* startPositionUs= */
0
,
/* startPositionUs= */
0
,
/* endPositionUs= */
C
.
TIME_END_OF_SOURCE
,
/* endPositionUs= */
C
.
TIME_END_OF_SOURCE
,
...
@@ -191,7 +191,7 @@ public final class MediaPeriodQueueTest {
...
@@ -191,7 +191,7 @@ public final class MediaPeriodQueueTest {
updateQueuedPeriods_withDurationChangeAfterReadingPeriod_handlesChangeAndRemovesPeriodsAfterChangedPeriod
()
{
updateQueuedPeriods_withDurationChangeAfterReadingPeriod_handlesChangeAndRemovesPeriodsAfterChangedPeriod
()
{
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
);
SECOND_AD_START_TIME_US
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -204,7 +204,7 @@ public final class MediaPeriodQueueTest {
...
@@ -204,7 +204,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
// Change position of second ad (= change duration of content between ads).
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
+
1
);
SECOND_AD_START_TIME_US
+
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -221,7 +221,7 @@ public final class MediaPeriodQueueTest {
...
@@ -221,7 +221,7 @@ public final class MediaPeriodQueueTest {
updateQueuedPeriods_withDurationChangeBeforeReadingPeriod_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod
()
{
updateQueuedPeriods_withDurationChangeBeforeReadingPeriod_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod
()
{
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
);
SECOND_AD_START_TIME_US
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -235,7 +235,7 @@ public final class MediaPeriodQueueTest {
...
@@ -235,7 +235,7 @@ public final class MediaPeriodQueueTest {
// Change position of first ad (= change duration of content before first ad).
// Change position of first ad (= change duration of content before first ad).
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
+
1
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
+
1
,
SECOND_AD_START_TIME_US
);
SECOND_AD_START_TIME_US
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -252,7 +252,7 @@ public final class MediaPeriodQueueTest {
...
@@ -252,7 +252,7 @@ public final class MediaPeriodQueueTest {
updateQueuedPeriods_withDurationChangeInReadingPeriodAfterReadingPosition_handlesChangeAndRemovesPeriodsAfterChangedPeriod
()
{
updateQueuedPeriods_withDurationChangeInReadingPeriodAfterReadingPosition_handlesChangeAndRemovesPeriodsAfterChangedPeriod
()
{
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
);
SECOND_AD_START_TIME_US
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -267,7 +267,7 @@ public final class MediaPeriodQueueTest {
...
@@ -267,7 +267,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
// Change position of second ad (= change duration of content between ads).
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
-
1000
);
SECOND_AD_START_TIME_US
-
1000
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -286,7 +286,7 @@ public final class MediaPeriodQueueTest {
...
@@ -286,7 +286,7 @@ public final class MediaPeriodQueueTest {
updateQueuedPeriods_withDurationChangeInReadingPeriodBeforeReadingPosition_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod
()
{
updateQueuedPeriods_withDurationChangeInReadingPeriodBeforeReadingPosition_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod
()
{
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
);
SECOND_AD_START_TIME_US
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -301,7 +301,7 @@ public final class MediaPeriodQueueTest {
...
@@ -301,7 +301,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
// Change position of second ad (= change duration of content between ads).
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
-
1000
);
SECOND_AD_START_TIME_US
-
1000
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -320,7 +320,7 @@ public final class MediaPeriodQueueTest {
...
@@ -320,7 +320,7 @@ public final class MediaPeriodQueueTest {
updateQueuedPeriods_withDurationChangeInReadingPeriodReadToEnd_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod
()
{
updateQueuedPeriods_withDurationChangeInReadingPeriodReadToEnd_doesntHandleChangeAndRemovesPeriodsAfterChangedPeriod
()
{
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
);
SECOND_AD_START_TIME_US
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
@@ -335,7 +335,7 @@ public final class MediaPeriodQueueTest {
...
@@ -335,7 +335,7 @@ public final class MediaPeriodQueueTest {
// Change position of second ad (= change duration of content between ads).
// Change position of second ad (= change duration of content between ads).
setupTimeline
(
setupTimeline
(
/* initialPositionUs= */
0
,
/* initialPositionUs= */
0
,
/* adGroupTimesUs= */
FIRST_AD_START_TIME_US
,
/* adGroupTimesUs
...
= */
FIRST_AD_START_TIME_US
,
SECOND_AD_START_TIME_US
-
1000
);
SECOND_AD_START_TIME_US
-
1000
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
0
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
setAdGroupLoaded
(
/* adGroupIndex= */
1
);
...
...
library/core/src/test/java/com/google/android/exoplayer2/audio/SilenceSkippingAudioProcessorTest.java
View file @
27b06e9a
...
@@ -268,10 +268,11 @@ public final class SilenceSkippingAudioProcessorTest {
...
@@ -268,10 +268,11 @@ public final class SilenceSkippingAudioProcessorTest {
Pcm16BitAudioBuilder
audioBuilder
=
new
Pcm16BitAudioBuilder
(
channelCount
,
totalFrameCount
);
Pcm16BitAudioBuilder
audioBuilder
=
new
Pcm16BitAudioBuilder
(
channelCount
,
totalFrameCount
);
while
(!
audioBuilder
.
isFull
())
{
while
(!
audioBuilder
.
isFull
())
{
int
silenceDurationFrames
=
(
silenceDurationMs
*
sampleRate
)
/
1000
;
int
silenceDurationFrames
=
(
silenceDurationMs
*
sampleRate
)
/
1000
;
audioBuilder
.
appendFrames
(
/* count= */
silenceDurationFrames
,
/* channelLevels= */
(
short
)
0
);
audioBuilder
.
appendFrames
(
/* count= */
silenceDurationFrames
,
/* channelLevels...= */
(
short
)
0
);
int
noiseDurationFrames
=
(
noiseDurationMs
*
sampleRate
)
/
1000
;
int
noiseDurationFrames
=
(
noiseDurationMs
*
sampleRate
)
/
1000
;
audioBuilder
.
appendFrames
(
audioBuilder
.
appendFrames
(
/* count= */
noiseDurationFrames
,
/* channelLevels= */
Short
.
MAX_VALUE
);
/* count= */
noiseDurationFrames
,
/* channelLevels
...
= */
Short
.
MAX_VALUE
);
}
}
return
new
InputBufferProvider
(
audioBuilder
.
build
());
return
new
InputBufferProvider
(
audioBuilder
.
build
());
}
}
...
...
library/core/src/test/java/com/google/android/exoplayer2/source/SampleQueueTest.java
View file @
27b06e9a
...
@@ -1078,7 +1078,7 @@ public final class SampleQueueTest {
...
@@ -1078,7 +1078,7 @@ public final class SampleQueueTest {
* filled with the specified sample data.
* filled with the specified sample data.
*
*
* @param timeUs The expected buffer timestamp.
* @param timeUs The expected buffer timestamp.
* @param isKey
f
rame The expected keyframe flag.
* @param isKey
F
rame The expected keyframe flag.
* @param isEncrypted The expected encrypted flag.
* @param isEncrypted The expected encrypted flag.
* @param sampleData An array containing the expected sample data.
* @param sampleData An array containing the expected sample data.
* @param offset The offset in {@code sampleData} of the expected sample data.
* @param offset The offset in {@code sampleData} of the expected sample data.
...
@@ -1086,7 +1086,7 @@ public final class SampleQueueTest {
...
@@ -1086,7 +1086,7 @@ public final class SampleQueueTest {
*/
*/
private
void
assertReadSample
(
private
void
assertReadSample
(
long
timeUs
,
long
timeUs
,
boolean
isKey
f
rame
,
boolean
isKey
F
rame
,
boolean
isEncrypted
,
boolean
isEncrypted
,
byte
[]
sampleData
,
byte
[]
sampleData
,
int
offset
,
int
offset
,
...
@@ -1104,7 +1104,7 @@ public final class SampleQueueTest {
...
@@ -1104,7 +1104,7 @@ public final class SampleQueueTest {
assertThat
(
formatHolder
.
format
).
isNull
();
assertThat
(
formatHolder
.
format
).
isNull
();
// inputBuffer should be populated.
// inputBuffer should be populated.
assertThat
(
inputBuffer
.
timeUs
).
isEqualTo
(
timeUs
);
assertThat
(
inputBuffer
.
timeUs
).
isEqualTo
(
timeUs
);
assertThat
(
inputBuffer
.
isKeyFrame
()).
isEqualTo
(
isKey
f
rame
);
assertThat
(
inputBuffer
.
isKeyFrame
()).
isEqualTo
(
isKey
F
rame
);
assertThat
(
inputBuffer
.
isDecodeOnly
()).
isFalse
();
assertThat
(
inputBuffer
.
isDecodeOnly
()).
isFalse
();
assertThat
(
inputBuffer
.
isEncrypted
()).
isEqualTo
(
isEncrypted
);
assertThat
(
inputBuffer
.
isEncrypted
()).
isEqualTo
(
isEncrypted
);
inputBuffer
.
flip
();
inputBuffer
.
flip
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment