Commit 1d36a679 authored by Philipp Hancke's avatar Philipp Hancke Committed by Commit Bot

webrtc: add wpt to test unbundled payload type demuxing

BUG=chromium:1139052

Change-Id: I7c6449b6569251ac6b2320da5a373f637dd4be00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2476376
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818400}
parent 01c36d14
......@@ -6458,3 +6458,5 @@ crbug.com/1137716 [ Mac10.12 ] fast/events/mouse-cursor-image-set.html [ Pass Fa
crbug.com/1138589 [ Mac10.15 ] fast/events/mouse-cursor-image-set-svg.html [ Failure ]
crbug.com/1138591 [ Mac10.15 ] http/tests/dom/raf-throttling-out-of-view-cross-origin-page.html [ Failure ]
# WebRTC: Payload demuxing times out in Plan B. This is expected.
crbug.com/1139052 virtual/webrtc-wpt-plan-b/external/wpt/webrtc/protocol/unbundled-pt-demuxing.https.html [ Timeout ]
<!doctype html>
<meta charset=utf-8>
<title>RTCPeerConnection payload type demuxing for unbundled connections</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../RTCPeerConnection-helper.js"></script>
<script>
'use strict';
promise_test(async t => {
const caller = new RTCPeerConnection({bundlePolicy: 'max-compat'});
t.add_cleanup(() => caller.close());
const callee = new RTCPeerConnection();
t.add_cleanup(() => callee.close());
const stream = await getNoiseStream({video: true});
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
stream.getTracks().forEach(track => caller.addTrack(track, stream));
stream.getTracks().forEach(track => caller.addTrack(track.clone(), stream.clone()));
let callCount = 0;
let metadataToBeLoaded = new Promise(resolve => {
callee.ontrack = (e) => {
const stream = e.streams[0];
const v = document.createElement('video');
v.autoplay = true;
v.srcObject = stream;
v.id = stream.id
v.addEventListener('loadedmetadata', () => {
if (++callCount === 2) {
resolve();
}
});
};
});
exchangeIceCandidates(caller, callee);
const offer = await caller.createOffer();
// Replace BUNDLE, the mid header extension and all ssrc lines
// with bogus. The receiver will be forced to do payload type demuxing
// which is still possible because the different m-lines arrive on
// different ports/sockets.
const sdp = offer.sdp.replace('BUNDLE', 'SOMETHING')
.replace(/rtp-hdrext:sdes/g, 'rtp-hdrext:something')
.replace(/a=ssrc:/g, 'a=notssrc');
await callee.setRemoteDescription({type: 'offer', sdp});
await caller.setLocalDescription(offer);
const answer = await callee.createAnswer();
await caller.setRemoteDescription(answer);
await callee.setLocalDescription(answer);
await metadataToBeLoaded;
}, 'Can demux two video tracks on an unbundled connection by payload type');
</script>
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