function verifyRtpReceivers(expectedNumTracks = null) {
  if (peerConnection_().getReceivers() == null)
    throw failTest('getReceivers() returns null or undefined.');
  if (expectedNumTracks != null &&
      peerConnection_().getReceivers().length != expectedNumTracks) {
    throw failTest('getReceivers().length != expectedNumTracks');
  }
  if (!arrayEquals_(peerConnection_().getReceivers(),
                    peerConnection_().getReceivers())) {
    throw failTest('One getReceivers() call is not equal to the next.');
  }

  let receivers = new Set();
  let receiverTracks = new Set();
  peerConnection_().getReceivers().forEach(function(receiver) {
    if (receiver == null)
      throw failTest('receiver is null or undefined.');
    if (receiver.track == null)
      throw failTest('receiver.track is null or undefined.');
    if (receiver.getContributingSources().length != 0)
      throw failTest('receiver.getContributingSources() is not empty.');
    receivers.add(receiver);
    receiverTracks.add(receiver.track);
  });
  if (receiverTracks.size != receivers.size)
    throw failTest('receiverTracks.size != receivers.size');

  returnToTest('ok-receivers-verified');
}
/**
 * Verifies that the peer connection's getReceivers() returns one receiver per
 * remote track, that there are no duplicates and that object identity is
 * preserved.
 *
 * Returns "ok-receivers-verified" on success.
 */
Verifies that the peer connection's getReceivers() returns one receiver per
remote track, that there are no duplicates and that object identity is
preserved.

Returns "ok-receivers-verified" on success.
Verifies that the peer connection ' s getReceivers () returns one receiver per remote track that there are no duplicates and that object identity is preserved . Returns " ok - receivers - verified " on success .
function verifyRtpReceivers(expectedNumTracks = null) {
  if (peerConnection_().getReceivers() == null)
    throw failTest('getReceivers() returns null or undefined.');
  if (expectedNumTracks != null &&
      peerConnection_().getReceivers().length != expectedNumTracks) {
    throw failTest('getReceivers().length != expectedNumTracks');
  }
  if (!arrayEquals_(peerConnection_().getReceivers(),
                    peerConnection_().getReceivers())) {
    throw failTest('One getReceivers() call is not equal to the next.');
  }
  let receivers = new Set();
  let receiverTracks = new Set();
  peerConnection_().getReceivers().forEach(function(receiver) {
    if (receiver == null)
      throw failTest('receiver is null or undefined.');
    if (receiver.track == null)
      throw failTest('receiver.track is null or undefined.');
    if (receiver.getContributingSources().length != 0)
      throw failTest('receiver.getContributingSources() is not empty.');
    receivers.add(receiver);
    receiverTracks.add(receiver.track);
  });
  if (receiverTracks.size != receivers.size)
    throw failTest('receiverTracks.size != receivers.size');
  returnToTest('ok-receivers-verified');
}
function verifyRtpReceivers ( expectedNumTracks = null ) { if ( peerConnection_ ( ) . getReceivers ( ) == null ) throw failTest ( 'getReceivers() returns null or undefined.' ) ; if ( expectedNumTracks != null && peerConnection_ ( ) . getReceivers ( ) . length != expectedNumTracks ) { throw failTest ( 'getReceivers().length != expectedNumTracks' ) ; } if ( ! arrayEquals_ ( peerConnection_ ( ) . getReceivers ( ) , peerConnection_ ( ) . getReceivers ( ) ) ) { throw failTest ( 'One getReceivers() call is not equal to the next.' ) ; } let receivers = new Set ( ) ; let receiverTracks = new Set ( ) ; peerConnection_ ( ) . getReceivers ( ) . forEach ( function ( receiver ) { if ( receiver == null ) throw failTest ( 'receiver is null or undefined.' ) ; if ( receiver . track == null ) throw failTest ( 'receiver.track is null or undefined.' ) ; if ( receiver . getContributingSources ( ) . length != 0 ) throw failTest ( 'receiver.getContributingSources() is not empty.' ) ; receivers . add ( receiver ) ; receiverTracks . add ( receiver . track ) ; } ) ; if ( receiverTracks . size != receivers . size ) throw failTest ( 'receiverTracks.size != receivers.size' ) ; returnToTest ( 'ok-receivers-verified' ) ; }
Verifies that the peer connection's getReceivers() returns one receiver per
 remote track, that there are no duplicates and that object identity is
 preserved.
Verifies that the peer connection ' s getReceivers () returns one receiver per remote track that there are no duplicates and that object identity is preserved .