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
a8ae98b1
authored
Jun 25, 2020
by
krocard
Committed by
Christos Tsilopoulos
Jun 26, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Test that ExoPlayer can be built in a background thread
PiperOrigin-RevId: 318264209
parent
aaa7fd11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 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 @
a8ae98b1
...
@@ -105,6 +105,7 @@ import org.junit.Before;
...
@@ -105,6 +105,7 @@ import org.junit.Before;
import
org.junit.Ignore
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.junit.runner.RunWith
;
import
org.robolectric.annotation.Config
;
import
org.robolectric.annotation.LooperMode
;
import
org.robolectric.annotation.LooperMode
;
import
org.robolectric.shadows.ShadowAudioManager
;
import
org.robolectric.shadows.ShadowAudioManager
;
...
@@ -6766,6 +6767,20 @@ public final class ExoPlayerTest {
...
@@ -6766,6 +6767,20 @@ public final class ExoPlayerTest {
assertThat
(
initialMediaItems
).
containsExactlyElementsIn
(
currentMediaItems
);
assertThat
(
initialMediaItems
).
containsExactlyElementsIn
(
currentMediaItems
);
}
}
// TODO: Revert to @Config(sdk = Config.ALL_SDKS) once b/143232359 is resolved
@Test
@Config
(
minSdk
=
Config
.
OLDEST_SDK
,
maxSdk
=
Config
.
TARGET_SDK
)
public
void
buildSimpleExoPlayerInBackgroundThread_doesNotThrow
()
throws
Exception
{
Thread
builderThread
=
new
Thread
(()
->
new
SimpleExoPlayer
.
Builder
(
context
).
build
());
AtomicReference
<
Throwable
>
builderThrow
=
new
AtomicReference
<>();
builderThread
.
setUncaughtExceptionHandler
((
thread
,
throwable
)
->
builderThrow
.
set
(
throwable
));
builderThread
.
start
();
builderThread
.
join
();
assertThat
(
builderThrow
.
get
()).
isNull
();
}
// Internal methods.
// Internal methods.
private
static
ActionSchedule
.
Builder
addSurfaceSwitch
(
ActionSchedule
.
Builder
builder
)
{
private
static
ActionSchedule
.
Builder
addSurfaceSwitch
(
ActionSchedule
.
Builder
builder
)
{
...
...
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