use of androidx.media3.exoplayer.trackselection.TrackSelector.InvalidationListener in project media by androidx.
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 androidx.media3.exoplayer.trackselection.TrackSelector.InvalidationListener in project media by androidx.
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 androidx.media3.exoplayer.trackselection.TrackSelector.InvalidationListener in project media by androidx.
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