diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/webrtc/protocol/sdes-dont-dont-dont.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/webrtc/protocol/sdes-dont-dont-dont.html')
-rw-r--r-- | testing/web-platform/tests/webrtc/protocol/sdes-dont-dont-dont.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webrtc/protocol/sdes-dont-dont-dont.html b/testing/web-platform/tests/webrtc/protocol/sdes-dont-dont-dont.html new file mode 100644 index 0000000000..dcf7ad1b54 --- /dev/null +++ b/testing/web-platform/tests/webrtc/protocol/sdes-dont-dont-dont.html @@ -0,0 +1,49 @@ +<!doctype html> +<meta charset=utf-8> +<meta name="timeout" content="long"> +<title>RTCPeerConnection MUST NOT support SDES</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../RTCPeerConnection-helper.js"></script> +<script src="/webrtc/third_party/sdp/sdp.js"></script> +<script> +'use strict'; + +// Test support for +// https://www.rfc-editor.org/rfc/rfc8826#section-4.3.1 + +const sdp = `v=0 +o=- 0 3 IN IP4 127.0.0.1 +s=- +t=0 0 +m=video 9 UDP/TLS/RTP/SAVPF 100 +c=IN IP4 0.0.0.0 +a=rtcp-mux +a=sendonly +a=mid:video +a=rtpmap:100 VP8/90000 +a=fmtp:100 max-fr=30;max-fs=3600 +a=crypto:0 AES_CM_128_HMAC_SHA1_80 inline:2nra27hTUb9ilyn2rEkBEQN9WOFts26F/jvofasw +a=ice-ufrag:ETEn +a=ice-pwd:OtSK0WpNtpUjkY4+86js7Z/l +`; + +// Negative test for Chrome legacy behavior. +promise_test(async t => { + const sdes_constraint = {'mandatory': {'DtlsSrtpKeyAgreement': false}}; + const pc = new RTCPeerConnection(null, sdes_constraint); + t.add_cleanup(() => pc.close()); + + pc.addTransceiver('audio'); + const offer = await pc.createOffer(); + assert_false(offer.sdp.includes('\na=crypto:')); +}, 'Does not create offers with SDES'); + +promise_test(t => { + const pc = new RTCPeerConnection(); + t.add_cleanup(() => pc.close()); + + return promise_rejects_dom(t, 'InvalidAccessError', + pc.setRemoteDescription({type: 'offer', sdp})); +}, 'rejects a remote offer that only includes SDES and no DTLS fingerprint'); +</script> |