Skip to content

Commit c29a034

Browse files
fippochromium-wpt-export-bot
authored andcommitted
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 <[email protected]> Commit-Queue: Philipp Hancke <[email protected]> Cr-Commit-Position: refs/heads/main@{#1082313}
1 parent 9a6e6ee commit c29a034

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

webrtc/RTCRtpTransceiver.https.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -376,27 +376,6 @@
376376
hasProps(pc.getTransceivers(), []);
377377
};
378378

379-
const checkMsidNoTrackId = async t => {
380-
const pc1 = new RTCPeerConnection();
381-
const pc2 = new RTCPeerConnection();
382-
t.add_cleanup(() => pc1.close());
383-
t.add_cleanup(() => pc2.close());
384-
const stream = await getNoiseStream({audio: true});
385-
t.add_cleanup(() => stopTracks(stream));
386-
const track = stream.getAudioTracks()[0];
387-
pc1.addTrack(track, stream);
388-
const offer = await pc1.createOffer();
389-
await pc1.setLocalDescription(offer);
390-
// Remove track-id from msid
391-
// Fixate stream-id so that error message is consistent.
392-
offer.sdp = offer.sdp.replace(/(a=msid:[^ \t]+).*\r\n/g,
393-
"a=msid:fake-stream-id\r\n");
394-
await pc2.setRemoteDescription(offer);
395-
const answer = await pc2.createAnswer();
396-
await pc1.setRemoteDescription(answer);
397-
await pc2.setLocalDescription(answer);
398-
};
399-
400379
const checkNoMidOffer = async t => {
401380
const pc1 = new RTCPeerConnection();
402381
const pc2 = new RTCPeerConnection();
@@ -2277,7 +2256,6 @@
22772256
checkAddTransceiverWithTrack,
22782257
checkAddTransceiverWithAddTrack,
22792258
checkAddTransceiverWithDirection,
2280-
checkMsidNoTrackId,
22812259
checkAddTransceiverWithSetRemoteOfferSending,
22822260
checkAddTransceiverWithSetRemoteOfferNoSend,
22832261
checkAddTransceiverBadKind,

webrtc/protocol/msid-parse.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,16 @@
6868
assert_equals(trackevent.streams.length, 2);
6969
}, 'Description with two msid produces two streams');
7070

71+
promise_test(async t => {
72+
const pc = new RTCPeerConnection();
73+
t.add_cleanup(() => pc.close());
74+
const ontrackPromise = addEventListenerPromise(t, pc, 'track');
75+
await pc.setRemoteDescription({type: 'offer',
76+
sdp: preamble + 'a=msid:foo\n'});
77+
const trackevent = await ontrackPromise;
78+
assert_equals(pc.getReceivers().length, 1);
79+
assert_equals(trackevent.streams.length, 1);
80+
assert_equals(trackevent.streams[0].id, 'foo');
81+
}, 'Description with msid foo but no track id is accepted');
82+
7183
</script>

0 commit comments

Comments
 (0)