tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 8ee1f50fcda2fdab16287b23cd189441c341833a
parent 1006210a7707167b51253a9de16d377e646319a1
Author: Philipp Hancke <philipp.hancke@googlemail.com>
Date:   Wed, 15 Oct 2025 08:57:58 +0000

Bug 1993996 [wpt PR 55390] - webrtc wpt: add tests for direction handling, a=testonly

Automatic update from web-platform-tests
webrtc wpt: add tests for direction handling

Bug: chromium:448408148
Change-Id: I01c097a44177547973bc9e65c1af48bb3b3e970b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7018294
Reviewed-by: Henrik Boström <hbos@chromium.org>
Reviewed-by: Harald Alvestrand <hta@chromium.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#1528800}

--

wpt-commits: e64f335eb2726fde9ee1be7056b1a900f1a70217
wpt-pr: 55390

Diffstat:
Atesting/web-platform/tests/webrtc/protocol/direction.html | 42++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/webrtc/protocol/direction.html b/testing/web-platform/tests/webrtc/protocol/direction.html @@ -0,0 +1,42 @@ +<!doctype html> +<meta charset=utf-8> +<title>RTCPeerconnection direction handling</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + +promise_test(async t => { + const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); + const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + + pc1.addTransceiver('audio').direction = 'recvonly'; + await pc1.setLocalDescription(); + await pc2.setRemoteDescription(pc1.localDescription); + await pc2.setLocalDescription(); + return promise_rejects_dom(t, 'InvalidAccessError', + pc1.setRemoteDescription({ + type: 'answer', + // Since pc2 had no track to send the m-line will be inactive. + sdp: pc2.localDescription.sdp.replace('inactive', 'recvonly') + })); +}, 'Rejects invalid modification of send direction'); + +promise_test(async t => { + const pc1 = new RTCPeerConnection(); + t.add_cleanup(() => pc1.close()); + const pc2 = new RTCPeerConnection(); + t.add_cleanup(() => pc2.close()); + + pc1.addTransceiver('audio').direction = 'sendonly'; + await pc1.setLocalDescription(); + await pc2.setRemoteDescription(pc1.localDescription); + await pc2.setLocalDescription(); + return promise_rejects_dom(t, 'InvalidAccessError', + pc1.setRemoteDescription({ + type: 'answer', + sdp: pc2.localDescription.sdp.replace('recvonly', 'sendrecv') + })); +}, 'Rejects invalid modification of receive direction'); +</script>