Skip to content

Commit

Permalink
[Rollback] Fix crash when removing a track being rolled back.
Browse files Browse the repository at this point in the history
Fixes https://crbug.com/1029641 and adds WPT test coverage.

Spec for removeTrack, which explicitly handles removeTrack by aborting:
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-removetrack

Bug: 1029641
Change-Id: I2c52e6711d34e0be25fad2681457eaf1eccc8f7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1962245
Commit-Queue: Henrik Boström <hbos@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723833}
  • Loading branch information
henbos authored and chromium-wpt-export-bot committed Dec 11, 2019
1 parent 224eac4 commit 3db20d2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions webrtc/RTCPeerConnection-setRemoteDescription-rollback.html
Expand Up @@ -538,4 +538,17 @@

}, "rollback of a remote offer with stream changes");

promise_test(async t => {
const pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
const pc2 = new RTCPeerConnection();
t.add_cleanup(() => pc2.close());
pc2.addTransceiver('audio');
const offer = await pc2.createOffer();
await pc1.setRemoteDescription(offer);
const [transceiver] = pc1.getTransceivers();
pc1.setRemoteDescription({type:'rollback'});
pc1.removeTrack(transceiver.sender);
}, 'removeTrack() with a sender being rolled back does not crash or throw');

</script>

0 comments on commit 3db20d2

Please sign in to comment.