webrtc wpt: add more tests for msid parsing
BUG=webrtc:14745,webrtc:14729
Change-Id: I7dc6b434625e5056d475d5e0d2b884ed28e14c9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4094255
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1082313}
diff --git a/webrtc/RTCRtpTransceiver.https.html b/webrtc/RTCRtpTransceiver.https.html
index b02ce60..9a8fbed 100644
--- a/webrtc/RTCRtpTransceiver.https.html
+++ b/webrtc/RTCRtpTransceiver.https.html
@@ -376,27 +376,6 @@
hasProps(pc.getTransceivers(), []);
};
- const checkMsidNoTrackId = async t => {
- const pc1 = new RTCPeerConnection();
- const pc2 = new RTCPeerConnection();
- t.add_cleanup(() => pc1.close());
- t.add_cleanup(() => pc2.close());
- const stream = await getNoiseStream({audio: true});
- t.add_cleanup(() => stopTracks(stream));
- const track = stream.getAudioTracks()[0];
- pc1.addTrack(track, stream);
- const offer = await pc1.createOffer();
- await pc1.setLocalDescription(offer);
- // Remove track-id from msid
- // Fixate stream-id so that error message is consistent.
- offer.sdp = offer.sdp.replace(/(a=msid:[^ \t]+).*\r\n/g,
- "a=msid:fake-stream-id\r\n");
- await pc2.setRemoteDescription(offer);
- const answer = await pc2.createAnswer();
- await pc1.setRemoteDescription(answer);
- await pc2.setLocalDescription(answer);
- };
-
const checkNoMidOffer = async t => {
const pc1 = new RTCPeerConnection();
const pc2 = new RTCPeerConnection();
@@ -2277,7 +2256,6 @@
checkAddTransceiverWithTrack,
checkAddTransceiverWithAddTrack,
checkAddTransceiverWithDirection,
- checkMsidNoTrackId,
checkAddTransceiverWithSetRemoteOfferSending,
checkAddTransceiverWithSetRemoteOfferNoSend,
checkAddTransceiverBadKind,
diff --git a/webrtc/protocol/msid-parse.html b/webrtc/protocol/msid-parse.html
index 9630919..5596446 100644
--- a/webrtc/protocol/msid-parse.html
+++ b/webrtc/protocol/msid-parse.html
@@ -68,4 +68,16 @@
assert_equals(trackevent.streams.length, 2);
}, 'Description with two msid produces two streams');
+promise_test(async t => {
+ const pc = new RTCPeerConnection();
+ t.add_cleanup(() => pc.close());
+ const ontrackPromise = addEventListenerPromise(t, pc, 'track');
+ await pc.setRemoteDescription({type: 'offer',
+ sdp: preamble + 'a=msid:foo\n'});
+ const trackevent = await ontrackPromise;
+ assert_equals(pc.getReceivers().length, 1);
+ assert_equals(trackevent.streams.length, 1);
+ assert_equals(trackevent.streams[0].id, 'foo');
+}, 'Description with msid foo but no track id is accepted');
+
</script>