static/tests/frontend/specs/race_conditions.js
// regardless, but in case we ever change things around, perhaps this test will catch something.
regardless, but in case we ever change things around, perhaps this test will catch something.
regardless but in case we ever change things around perhaps this test will catch something .
function testDeactivateClickActivate(done) {
    const chrome$ = helper.padChrome$;
    function loop(i) {
      originalAudioTrack = audioTrack;
      expect(originalAudioTrack).to.equal(audioTrack);
      expect(chrome$('.audio-btn').hasClass('muted')).to.equal(!audioTrack.enabled);
      originalVideoTrack = videoTrack;
      expect(originalVideoTrack).to.equal(videoTrack);
      expect(chrome$('.video-btn').hasClass('off')).to.equal(!videoTrack.enabled);
      chrome$.window.ep_webrtc.deactivate();
      chrome$('.audio-btn').click();
      chrome$('.video-btn').click();
      chrome$.window.ep_webrtc.activate().then(() => {
        expect(originalAudioTrack).to.not.equal(audioTrack);
        expect(originalAudioTrack.readyState).to.equal('ended');
        expect(audioTrack.readyState).to.equal('live');
        expect(originalVideoTrack).to.not.equal(videoTrack);
        expect(originalVideoTrack.readyState).to.equal('ended');
        expect(videoTrack.readyState).to.equal('live');
        expect(chrome$('.audio-btn').hasClass('muted')).to.equal(!audioTrack.enabled);
        expect(chrome$('.video-btn').hasClass('off')).to.equal(!videoTrack.enabled);
        if (i > 0) {
          return loop(i - 1);
        } else {
          done();
        }
      });
    }
    loop(10);
  }
function testDeactivateClickActivate ( done ) { const chrome$ = helper . padChrome$ ; function loop ( i ) { originalAudioTrack = audioTrack ; expect ( originalAudioTrack ) . to . equal ( audioTrack ) ; expect ( chrome$ ( '.audio-btn' ) . hasClass ( 'muted' ) ) . to . equal ( ! audioTrack . enabled ) ; originalVideoTrack = videoTrack ; expect ( originalVideoTrack ) . to . equal ( videoTrack ) ; expect ( chrome$ ( '.video-btn' ) . hasClass ( 'off' ) ) . to . equal ( ! videoTrack . enabled ) ; chrome$ . window . ep_webrtc . deactivate ( ) ; chrome$ ( '.audio-btn' ) . click ( ) ; chrome$ ( '.video-btn' ) . click ( ) ; chrome$ . window . ep_webrtc . activate ( ) . then ( ( ) => { expect ( originalAudioTrack ) . to . not . equal ( audioTrack ) ; expect ( originalAudioTrack . readyState ) . to . equal ( 'ended' ) ; expect ( audioTrack . readyState ) . to . equal ( 'live' ) ; expect ( originalVideoTrack ) . to . not . equal ( videoTrack ) ; expect ( originalVideoTrack . readyState ) . to . equal ( 'ended' ) ; expect ( videoTrack . readyState ) . to . equal ( 'live' ) ; expect ( chrome$ ( '.audio-btn' ) . hasClass ( 'muted' ) ) . to . equal ( ! audioTrack . enabled ) ; expect ( chrome$ ( '.video-btn' ) . hasClass ( 'off' ) ) . to . equal ( ! videoTrack . enabled ) ; if ( i > 0 ) { return loop ( i - 1 ) ; } else { done ( ) ; } } ) ; } loop ( 10 ) ; }
regardless, but in case we ever change things around, perhaps this test will catch something.
regardless but in case we ever change things around perhaps this test will catch something .
// getUserMedia should give us new audio and video Tracks and disable the old one // The mute state should be consistent with icon, wherever they land