Update web-platform-tests to revision b'2d7c53f5bc604132d2c83955537e454ee9c788c0'

This commit is contained in:
WPT Sync Bot 2023-01-18 01:45:07 +00:00
parent 619a46113f
commit 1c6b303ef2
396 changed files with 29611 additions and 1967 deletions

View file

@ -0,0 +1,26 @@
"use strict";
async function setupLoopbackWithCodecAndGetReader(t, codec) {
const caller = new RTCPeerConnection({encodedInsertableStreams:true});
t.add_cleanup(() => caller.close());
const callee = new RTCPeerConnection();
t.add_cleanup(() => callee.close());
await setMediaPermission("granted", ["camera"]);
const stream = await navigator.mediaDevices.getUserMedia({video:true});
const videoTrack = stream.getVideoTracks()[0];
t.add_cleanup(() => videoTrack.stop());
const transceiver = caller.addTransceiver(videoTrack);
const codecCapability =
RTCRtpSender.getCapabilities('video').codecs.find(capability => {
return capability.mimeType.includes(codec);
});
assert_not_equals(codecCapability, undefined);
transceiver.setCodecPreferences([codecCapability]);
const senderStreams = transceiver.sender.createEncodedStreams();
exchangeIceCandidates(caller, callee);
await exchangeOfferAnswer(caller, callee);
return senderStreams.readable.getReader();
}