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
9a0203e9
authored
Aug 10, 2020
by
samrobinson
Committed by
kim-vde
Aug 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Change experimental method naming for blockUntilDelivered.
PiperOrigin-RevId: 325786522
parent
eb946345
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
library/core/src/main/java/com/google/android/exoplayer2/PlayerMessage.java
library/core/src/test/java/com/google/android/exoplayer2/PlayerMessageTest.java
library/core/src/main/java/com/google/android/exoplayer2/PlayerMessage.java
View file @
9a0203e9
...
...
@@ -323,13 +323,13 @@ public final class PlayerMessage {
* @throws InterruptedException If the current thread is interrupted while waiting for the message
* to be delivered.
*/
public
synchronized
boolean
experimental
_b
lockUntilDelivered
(
long
timeoutMs
)
public
synchronized
boolean
experimental
B
lockUntilDelivered
(
long
timeoutMs
)
throws
InterruptedException
,
TimeoutException
{
return
experimental
_b
lockUntilDelivered
(
timeoutMs
,
Clock
.
DEFAULT
);
return
experimental
B
lockUntilDelivered
(
timeoutMs
,
Clock
.
DEFAULT
);
}
@VisibleForTesting
()
/* package */
synchronized
boolean
experimental
_b
lockUntilDelivered
(
long
timeoutMs
,
Clock
clock
)
/* package */
synchronized
boolean
experimental
B
lockUntilDelivered
(
long
timeoutMs
,
Clock
clock
)
throws
InterruptedException
,
TimeoutException
{
Assertions
.
checkState
(
isSent
);
Assertions
.
checkState
(
handler
.
getLooper
().
getThread
()
!=
Thread
.
currentThread
());
...
...
library/core/src/test/java/com/google/android/exoplayer2/PlayerMessageTest.java
View file @
9a0203e9
...
...
@@ -66,30 +66,30 @@ public class PlayerMessageTest {
}
@Test
public
void
experimental
_b
lockUntilDelivered_timesOut
()
throws
Exception
{
public
void
experimental
B
lockUntilDelivered_timesOut
()
throws
Exception
{
when
(
clock
.
elapsedRealtime
()).
thenReturn
(
0L
).
thenReturn
(
TIMEOUT_MS
*
2
);
try
{
message
.
send
().
experimental
_b
lockUntilDelivered
(
TIMEOUT_MS
,
clock
);
message
.
send
().
experimental
B
lockUntilDelivered
(
TIMEOUT_MS
,
clock
);
fail
();
}
catch
(
TimeoutException
expected
)
{
}
// Ensure experimental
_b
lockUntilDelivered() entered the blocking loop
// Ensure experimental
B
lockUntilDelivered() entered the blocking loop
verify
(
clock
,
Mockito
.
times
(
2
)).
elapsedRealtime
();
}
@Test
public
void
experimental
_b
lockUntilDelivered_onAlreadyProcessed_succeeds
()
throws
Exception
{
public
void
experimental
B
lockUntilDelivered_onAlreadyProcessed_succeeds
()
throws
Exception
{
when
(
clock
.
elapsedRealtime
()).
thenReturn
(
0L
);
message
.
send
().
markAsProcessed
(
/* isDelivered= */
true
);
assertThat
(
message
.
experimental
_b
lockUntilDelivered
(
TIMEOUT_MS
,
clock
)).
isTrue
();
assertThat
(
message
.
experimental
B
lockUntilDelivered
(
TIMEOUT_MS
,
clock
)).
isTrue
();
}
@Test
public
void
experimental
_b
lockUntilDelivered_markAsProcessedWhileBlocked_succeeds
()
public
void
experimental
B
lockUntilDelivered_markAsProcessedWhileBlocked_succeeds
()
throws
Exception
{
message
.
send
();
...
...
@@ -114,8 +114,8 @@ public class PlayerMessageTest {
});
try
{
assertThat
(
message
.
experimental
_b
lockUntilDelivered
(
TIMEOUT_MS
,
clock
)).
isTrue
();
// Ensure experimental
_b
lockUntilDelivered() entered the blocking loop.
assertThat
(
message
.
experimental
B
lockUntilDelivered
(
TIMEOUT_MS
,
clock
)).
isTrue
();
// Ensure experimental
B
lockUntilDelivered() entered the blocking loop.
verify
(
clock
,
Mockito
.
atLeast
(
2
)).
elapsedRealtime
();
future
.
get
(
1
,
SECONDS
);
}
finally
{
...
...
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