otalk / rtcpeerconnection-shim

Implementation of the RTCPeerConnection API ontop of ORTC
BSD 3-Clause "New" or "Revised" License
15 stars 14 forks source link

error thrown in createOffer for a rejected datachannel #166

Closed fippo closed 5 years ago

fippo commented 5 years ago
    describe('rejects a legacy datachannel offer', () => {
...
      it.only('in setRemoteDescription with a local track', () => {
        // test that we don't forget about the track.
        return navigator.mediaDevices.getUserMedia({audio: true})
          .then((stream) => {
            pc.addTrack(stream.getTracks()[0], stream);
            return pc.setRemoteDescription({type: 'offer', sdp: sdp});
          })
          .then(() => pc.createAnswer())
          .then((answer) => pc.setLocalDescription(answer))
          .then(() => pc.createOffer())
          .then((offer) => {
            const sections = SDPUtils.getMediaSections(offer.sdp);
            expect(sections).to.have.length(2);
            expect(SDPUtils.isRejected(sections[0])).to.equal(true);
            expect(SDPUtils.kind(sections[1])).to.equal('audio');
          });
      });

This does weird stuff in createOffer, creating an ice gatherer for the rejected m-line and then failing.