use of com.google.android.exoplayer2.trackselection.TrackSelector.InvalidationListener in project ExoPlayer by google.
the class DefaultTrackSelectorTest method setParameterWithSameParametersDoesNotNotifyInvalidationListenerAgain.
/**
* Tests that track selector will not call {@link
* InvalidationListener#onTrackSelectionsInvalidated()} again when it's set with the same values
* of {@link Parameters}.
*/
@Test
public void setParameterWithSameParametersDoesNotNotifyInvalidationListenerAgain() {
ParametersBuilder builder = defaultParameters.buildUpon().setPreferredAudioLanguage("eng");
trackSelector.setParameters(builder);
trackSelector.setParameters(builder);
verify(invalidationListener, times(1)).onTrackSelectionsInvalidated();
}
use of com.google.android.exoplayer2.trackselection.TrackSelector.InvalidationListener in project ExoPlayer by google.
the class DefaultTrackSelectorTest method setParameterWithNonDefaultParameterNotifyInvalidationListener.
/**
* Tests that track selector will call {@link InvalidationListener#onTrackSelectionsInvalidated()}
* when it's set with non-default values of {@link Parameters}.
*/
@Test
public void setParameterWithNonDefaultParameterNotifyInvalidationListener() {
ParametersBuilder builder = defaultParameters.buildUpon().setPreferredAudioLanguage("eng");
trackSelector.setParameters(builder);
verify(invalidationListener).onTrackSelectionsInvalidated();
}
use of com.google.android.exoplayer2.trackselection.TrackSelector.InvalidationListener in project ExoPlayer by google.
the class TrackSelectorTest method getBandwidthMeter_afterInitialization_returnsProvidedBandwidthMeter.
@Test
public void getBandwidthMeter_afterInitialization_returnsProvidedBandwidthMeter() {
InvalidationListener invalidationListener = Mockito.mock(InvalidationListener.class);
BandwidthMeter bandwidthMeter = Mockito.mock(BandwidthMeter.class);
trackSelector.init(invalidationListener, bandwidthMeter);
assertThat(trackSelector.getBandwidthMeter()).isEqualTo(bandwidthMeter);
}
Aggregations