Publish test utils modules as release artificats.

This allows external users to easily write unit tests involving ExoPlayer
instances.

Issue:#6267
PiperOrigin-RevId: 266741790
This commit is contained in:
tonihei 2019-09-02 10:15:12 +01:00 committed by Toni
parent a02237de20
commit 33ef4184e8
5 changed files with 27 additions and 4 deletions

View file

@ -56,6 +56,8 @@
[#4249](https://github.com/google/ExoPlayer/issues/4249),
[#4319](https://github.com/google/ExoPlayer/issues/4319),
[#4337](https://github.com/google/ExoPlayer/issues/4337)).
* Publish `testutils` module to simplify unit testing with ExoPlayer
([#6267](https://github.com/google/ExoPlayer/issues/6267)).
### 2.10.4 ###

10
testutils/README.md Normal file
View file

@ -0,0 +1,10 @@
# ExoPlayer test utils #
Provides utility classes for ExoPlayer unit and instrumentation tests.
## Links ##
* [Javadoc][]: Classes matching `com.google.android.exoplayer2.testutil`
belong to this module.
[Javadoc]: https://exoplayer.dev/doc/reference/index.html

View file

@ -49,3 +49,14 @@ dependencies {
testImplementation project(modulePrefix + 'testutils')
testImplementation 'org.robolectric:robolectric:' + robolectricVersion
}
ext {
javadocTitle = 'Test utils'
}
apply from: '../javadoc_library.gradle'
ext {
releaseArtifact = 'exoplayer-testutils'
releaseDescription = 'Test utils for ExoPlayer.'
}
apply from: '../publish.gradle'

View file

@ -311,12 +311,12 @@ public final class ActionSchedule {
/**
* Schedules a new source preparation action to be executed.
* @see com.google.android.exoplayer2.ExoPlayer#prepare(MediaSource, boolean, boolean).
*
* @see com.google.android.exoplayer2.ExoPlayer#prepare(MediaSource, boolean, boolean)
* @return The builder, for convenience.
*/
public Builder prepareSource(MediaSource mediaSource, boolean resetPosition,
boolean resetState) {
public Builder prepareSource(
MediaSource mediaSource, boolean resetPosition, boolean resetState) {
return apply(new PrepareSource(tag, mediaSource, resetPosition, resetState));
}

View file

@ -34,7 +34,7 @@ import java.util.List;
/**
* Fake {@link MediaPeriod} that provides tracks from the given {@link TrackGroupArray}. Selecting a
* track will give the player a {@link ChunkSampleStream<FakeChunkSource>}.
* track will give the player a {@link ChunkSampleStream}.
*/
public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod
implements SequenceableLoader.Callback<ChunkSampleStream<FakeChunkSource>> {