function waitForConnectionToStabilize(peerConnection) {
  addExpectedEvent();
  var waitForStabilization = setInterval(function() {
    if (peerConnection.signalingState == 'stable') {
      clearInterval(waitForStabilization);
      eventOccured();
    }
  }, 100);
}
/**
 * Blocks test success until the provided peerconnection reports the signaling
 * state 'stable'.
 *
 * @param peerConnection The peer connection to look at.
 */
Blocks test success until the provided peerconnection reports the signaling
state 'stable'.

@param peerConnection The peer connection to look at.
Blocks test success until the provided peerconnection reports the signaling state ' stable ' . @param peerConnection The peer connection to look at .
function waitForConnectionToStabilize(peerConnection) {
  addExpectedEvent();
  var waitForStabilization = setInterval(function() {
    if (peerConnection.signalingState == 'stable') {
      clearInterval(waitForStabilization);
      eventOccured();
    }
  }, 100);
}
function waitForConnectionToStabilize ( peerConnection ) { addExpectedEvent ( ) ; var waitForStabilization = setInterval ( function ( ) { if ( peerConnection . signalingState == 'stable' ) { clearInterval ( waitForStabilization ) ; eventOccured ( ) ; } } , 100 ) ; }
Blocks test success until the provided peerconnection reports the signaling
 state 'stable'.
Blocks test success until the provided peerconnection reports the signaling state ' stable ' .