Skip to content

Commit

Permalink
test code
Browse files Browse the repository at this point in the history
  • Loading branch information
USAMAWIZARD committed Dec 19, 2023
1 parent a19de95 commit b5dddff
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -995,16 +995,17 @@ public void testAddRemoveRemoteIceCandidate() {
@Test
public void testDegradationPreference() {
RtpParameters.DegradationPreference degradationPreference = RtpParameters.DegradationPreference.BALANCED;
webRTCClient.getConfig().activity=null;
webRTCClient.setDegradationPreference(degradationPreference);
//will return imediately

webRTCClient.getConfig().activity= mock(Activity.class);
List<RtpSender> senders = new ArrayList<>();
RtpSender sender = mock(RtpSender.class);
senders.add(sender);
webRTCClient.localVideoSender = sender;

webRTCClient.localVideoSender = null;
webRTCClient.setDegradationPreference(degradationPreference);
verify(sender, never()).setParameters(any());

webRTCClient.localVideoSender = sender;
RtpParameters parameters = mock(RtpParameters.class);
when(sender.getParameters()).thenReturn(parameters);

Expand Down

0 comments on commit b5dddff

Please sign in to comment.