summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webrtc/RTCRtpReceiver.https.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /testing/web-platform/tests/webrtc/RTCRtpReceiver.https.html
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/webrtc/RTCRtpReceiver.https.html')
-rw-r--r--testing/web-platform/tests/webrtc/RTCRtpReceiver.https.html96
1 files changed, 96 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webrtc/RTCRtpReceiver.https.html b/testing/web-platform/tests/webrtc/RTCRtpReceiver.https.html
new file mode 100644
index 0000000000..eea013140f
--- /dev/null
+++ b/testing/web-platform/tests/webrtc/RTCRtpReceiver.https.html
@@ -0,0 +1,96 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCRtpReceiver</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+ 'use strict';
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ const transceiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ assert_equals(transceiver.receiver.transport, null);
+ }, 'RTCRtpReceiver should have a null transport initially');
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ const transceiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ await pc1.setLocalDescription();
+ assert_true(transceiver.receiver.transport instanceof RTCDtlsTransport);
+ }, 'RTCRtpReceiver should have a transport after sLD(offer)');
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ const transceiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ await pc1.setLocalDescription();
+ await pc1.setLocalDescription({type: 'rollback', sdp: ''});
+ assert_equals(transceiver.receiver.transport, null);
+ }, 'RTCRtpReceiver should have a null transport after rollback of sLD(offer)');
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ const pc2 = new RTCPeerConnection();
+ t.add_cleanup(() => pc2.close());
+ const receiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ await pc2.setRemoteDescription(await pc1.createOffer());
+ const transceiver = pc2.getTransceivers()[0];
+ assert_equals(transceiver.receiver.transport, null);
+ }, 'RTCRtpReceiver should have a null transport after sRD(offer)');
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ const transceiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ await pc1.setLocalDescription();
+ assert_true(transceiver.sender.transport instanceof RTCDtlsTransport);
+ assert_true(transceiver.receiver.transport instanceof RTCDtlsTransport);
+ assert_equals(transceiver.receiver.transport, transceiver.sender.transport);
+ }, 'RTCRtpReceiver should have the same transport object as its corresponding RTCRtpSender');
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection({bundlePolicy: 'max-bundle'});
+ t.add_cleanup(() => pc1.close());
+ const audioTransceiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ const videoTransceiver = pc1.addTransceiver('video', { direction: 'recvonly' });
+ await pc1.setLocalDescription();
+ assert_equals(videoTransceiver.receiver.transport, audioTransceiver.receiver.transport);
+ }, 'RTCRtpReceivers that share a bundle transport should have the same transport object');
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection({bundlePolicy: 'max-compat'});
+ t.add_cleanup(() => pc1.close());
+ const pc2 = new RTCPeerConnection();
+ t.add_cleanup(() => pc2.close());
+ const audioTransceiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ const videoTransceiver = pc1.addTransceiver('video', { direction: 'recvonly' });
+ await pc1.setLocalDescription();
+ assert_not_equals(videoTransceiver.receiver.transport, audioTransceiver.receiver.transport);
+ await pc2.setRemoteDescription(pc1.localDescription);
+ await pc1.setRemoteDescription(await pc2.createAnswer());
+ // pc2 will accept the bundle, so these should be the same now
+ assert_equals(videoTransceiver.receiver.transport, audioTransceiver.receiver.transport);
+ }, 'RTCRtpReceivers that do not necessarily share a bundle transport should not have the same transport object');
+
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ const pc2 = new RTCPeerConnection();
+ t.add_cleanup(() => pc2.close());
+
+ const transceiver = pc1.addTransceiver('audio', { direction: 'recvonly' });
+ await pc1.setLocalDescription();
+ const transportBefore = transceiver.receiver.transport;
+
+ await pc2.setRemoteDescription(pc1.localDescription);
+ await pc1.setRemoteDescription(await pc2.createAnswer());
+ await pc1.setLocalDescription(await pc1.createOffer({iceRestart: true}));
+
+ const transportAfter = transceiver.receiver.transport;
+ assert_equals(transportAfter, transportBefore);
+ }, 'RTCRtpReceiver should have the same transport object after an ICE restart');
+
+</script>