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
86a2f297
authored
Jun 10, 2022
by
ibaker
Committed by
Marc Baechinger
Jun 13, 2022
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove ExoPlayerTest.PlayerStateGrabber
It's no longer needed PiperOrigin-RevId: 454161070
parent
a90d5230
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
View file @
86a2f297
...
@@ -3890,13 +3890,19 @@ public final class ExoPlayerTest {
...
@@ -3890,13 +3890,19 @@ public final class ExoPlayerTest {
ShadowAudioManager
shadowAudioManager
=
shadowOf
(
context
.
getSystemService
(
AudioManager
.
class
));
ShadowAudioManager
shadowAudioManager
=
shadowOf
(
context
.
getSystemService
(
AudioManager
.
class
));
shadowAudioManager
.
setNextFocusRequestResponse
(
AudioManager
.
AUDIOFOCUS_REQUEST_FAILED
);
shadowAudioManager
.
setNextFocusRequestResponse
(
AudioManager
.
AUDIOFOCUS_REQUEST_FAILED
);
PlayerStateGrabber
playerStateGrabber
=
new
PlayerStateGrabber
();
AtomicBoolean
playWhenReady
=
new
AtomicBoolean
();
ActionSchedule
actionSchedule
=
ActionSchedule
actionSchedule
=
new
ActionSchedule
.
Builder
(
TAG
)
new
ActionSchedule
.
Builder
(
TAG
)
.
setAudioAttributes
(
AudioAttributes
.
DEFAULT
,
/* handleAudioFocus= */
true
)
.
setAudioAttributes
(
AudioAttributes
.
DEFAULT
,
/* handleAudioFocus= */
true
)
.
play
()
.
play
()
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
executeRunnable
(
playerStateGrabber
)
.
executeRunnable
(
new
PlayerRunnable
()
{
@Override
public
void
run
(
ExoPlayer
player
)
{
playWhenReady
.
set
(
player
.
getPlayWhenReady
());
}
})
.
build
();
.
build
();
AtomicBoolean
seenPlaybackSuppression
=
new
AtomicBoolean
();
AtomicBoolean
seenPlaybackSuppression
=
new
AtomicBoolean
();
Player
.
Listener
listener
=
Player
.
Listener
listener
=
...
@@ -3914,7 +3920,7 @@ public final class ExoPlayerTest {
...
@@ -3914,7 +3920,7 @@ public final class ExoPlayerTest {
.
start
()
.
start
()
.
blockUntilActionScheduleFinished
(
TIMEOUT_MS
);
.
blockUntilActionScheduleFinished
(
TIMEOUT_MS
);
assertThat
(
play
erStateGrabber
.
playWhenReady
).
isFalse
();
assertThat
(
play
WhenReady
.
get
()
).
isFalse
();
assertThat
(
seenPlaybackSuppression
.
get
()).
isFalse
();
assertThat
(
seenPlaybackSuppression
.
get
()).
isFalse
();
}
}
...
@@ -12214,19 +12220,6 @@ public final class ExoPlayerTest {
...
@@ -12214,19 +12220,6 @@ public final class ExoPlayerTest {
}
}
}
}
private
static
final
class
PlayerStateGrabber
extends
PlayerRunnable
{
public
boolean
playWhenReady
;
public
@Player
.
State
int
playbackState
;
@Nullable
public
Timeline
timeline
;
@Override
public
void
run
(
ExoPlayer
player
)
{
playWhenReady
=
player
.
getPlayWhenReady
();
playbackState
=
player
.
getPlaybackState
();
timeline
=
player
.
getCurrentTimeline
();
}
}
/**
/**
* Provides a wrapper for a {@link Runnable} which does collect playback states and window counts.
* Provides a wrapper for a {@link Runnable} which does collect playback states and window counts.
* Can be used with {@link ActionSchedule.Builder#executeRunnable(Runnable)} to verify that a
* Can be used with {@link ActionSchedule.Builder#executeRunnable(Runnable)} to verify that a
...
...
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