1
0
Fork 0
firefox/testing/web-platform/tests/fenced-frame/webrtc-peer-connection.https.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

33 lines
1.3 KiB
HTML

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="resources/utils.js"></script>
<title>Test that RTCPeerConnection construction fails in a fenced frame.</title>
<body>
<script>
promise_test(async (t) => {
let fencedframe = attachFencedFrameContext();
return fencedframe.execute(() => {
try {
// Copied from https://webrtc.org/getting-started/peer-connections.
// The contents of the configuration object doesn't matter here,
// because construction should fail before the information becomes
// relevant.
const configuration = {
'iceServers': [{'urls': 'stun:stun.example.com:19302'}]
};
const peerConnection = new RTCPeerConnection(configuration);
assert_unreached("RTCPeerConnection construction should fail in a " +
"fenced frame");
} catch (err) {
assert_equals(err.name, "NotAllowedError");
}
});
}, "Test that RTCPeerConnection construction fails in a fenced frame.");
</script>
</body>