Skip to content

Commit

Permalink
Publish test utils modules as release artificats.
Browse files Browse the repository at this point in the history
This allows external users to easily write unit tests involving ExoPlayer
instances.

Issue:#6267
PiperOrigin-RevId: 266741790
  • Loading branch information
tonihei committed Sep 5, 2019
1 parent a02237d commit 33ef418
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###

Expand Down
10 changes: 10 additions & 0 deletions testutils/README.md
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions testutils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ public Builder prepareSource(MediaSource mediaSource) {

/**
* 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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

/**
* 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>> {
Expand Down

0 comments on commit 33ef418

Please sign in to comment.