use of com.google.android.exoplayer2.testutil.MediaSourceTestRunner in project ExoPlayer by google.
the class MergingMediaSourceTest method createPeriod_createsChildPeriods.
@Test
public void createPeriod_createsChildPeriods() throws Exception {
FakeMediaSource[] mediaSources = new FakeMediaSource[2];
for (int i = 0; i < mediaSources.length; i++) {
mediaSources[i] = new FakeMediaSource(new FakeTimeline(/* windowCount= */
2));
}
MergingMediaSource mediaSource = new MergingMediaSource(mediaSources);
MediaSourceTestRunner testRunner = new MediaSourceTestRunner(mediaSource, null);
try {
testRunner.prepareSource();
testRunner.assertPrepareAndReleaseAllPeriods();
for (FakeMediaSource element : mediaSources) {
assertThat(element.getCreatedMediaPeriods()).isNotEmpty();
}
testRunner.releaseSource();
} finally {
testRunner.release();
}
}
Aggregations