function createReceiverWithSetRemoteDescription() {
  var pc = new RTCPeerConnection();
  var receivers = null;
  pc.setRemoteDescription(createOffer([msid('stream', 'track1')]))
      .then(() => {
        receivers = pc.getReceivers();
        if (receivers.length != 1)
          throw failTest('getReceivers() should return 1 receiver: ' +
                         receivers.length)
        if (!receivers[0].track)
          throw failTest('getReceivers()[0].track should have a value')
        returnToTest('ok');
      });
  receivers = pc.getReceivers();
  if (receivers.length != 0)
    throw failTest('getReceivers() should return 0 receivers: ' +
                   receivers.length)
}
// TODO(hbos): Make this a web platform test instead. https://crbug.com/773472
Make this a web platform test instead.
Make this a web platform test instead .
function createReceiverWithSetRemoteDescription() {
  var pc = new RTCPeerConnection();
  var receivers = null;
  pc.setRemoteDescription(createOffer([msid('stream', 'track1')]))
      .then(() => {
        receivers = pc.getReceivers();
        if (receivers.length != 1)
          throw failTest('getReceivers() should return 1 receiver: ' +
                         receivers.length)
        if (!receivers[0].track)
          throw failTest('getReceivers()[0].track should have a value')
        returnToTest('ok');
      });
  receivers = pc.getReceivers();
  if (receivers.length != 0)
    throw failTest('getReceivers() should return 0 receivers: ' +
                   receivers.length)
}
function createReceiverWithSetRemoteDescription ( ) { var pc = new RTCPeerConnection ( ) ; var receivers = null ; pc . setRemoteDescription ( createOffer ( [ msid ( 'stream' , 'track1' ) ] ) ) . then ( ( ) => { receivers = pc . getReceivers ( ) ; if ( receivers . length != 1 ) throw failTest ( 'getReceivers() should return 1 receiver: ' + receivers . length ) if ( ! receivers [ 0 ] . track ) throw failTest ( 'getReceivers()[0].track should have a value' ) returnToTest ( 'ok' ) ; } ) ; receivers = pc . getReceivers ( ) ; if ( receivers . length != 0 ) throw failTest ( 'getReceivers() should return 0 receivers: ' + receivers . length ) }
TODO(hbos): Make this a web platform test instead.
TODO ( hbos ) : Make this a web platform test instead .