Commit d7d68fd5 authored by Philipp Hancke's avatar Philipp Hancke Committed by Chromium LUCI CQ

webrtc: assert behaviour of unified-plan offers in plan-b

assert they do not throw and reject all the but first m=-line

BUG=799030

Change-Id: I4242eaacc7ae039a32643034eca535acf6cd1f7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627321Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/master@{#843414}
parent 4de82a47
...@@ -149,7 +149,9 @@ promise_test(async t => { ...@@ -149,7 +149,9 @@ promise_test(async t => {
promise_test(async t => { promise_test(async t => {
pc1 = new RTCPeerConnection({sdpSemantics: "plan-b"}); pc1 = new RTCPeerConnection({sdpSemantics: "plan-b"});
t.add_cleanup(() => pc1.close());
pc2 = new RTCPeerConnection({sdpSemantics: "unified-plan"}); pc2 = new RTCPeerConnection({sdpSemantics: "unified-plan"});
t.add_cleanup(() => pc2.close());
return navigator.mediaDevices.getUserMedia({video: true}) return navigator.mediaDevices.getUserMedia({video: true})
.then(stream => { .then(stream => {
pc1.addTrack(stream.getVideoTracks()[0]); pc1.addTrack(stream.getVideoTracks()[0]);
...@@ -170,6 +172,17 @@ promise_test(async t => { ...@@ -170,6 +172,17 @@ promise_test(async t => {
}, 'Plan B with one video track can connect to Unified plan'); }, 'Plan B with one video track can connect to Unified plan');
promise_test(async t => {
pc1 = new RTCPeerConnection({sdpSemantics: 'unified-plan'});
t.add_cleanup(() => pc1.close());
pc2 = new RTCPeerConnection({sdpSemantics: 'plan-b'});
t.add_cleanup(() => pc2.close());
pc1.addTransceiver('video');
pc1.addTransceiver('video');
await pc2.setRemoteDescription(await pc1.createOffer());
assert_equals(pc1.getReceivers().length, 2);
assert_equals(pc2.getReceivers().length, 1);
}, 'Plan B rejects additional m-lines without throwing an error');
</script> </script>
</body> </body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment