Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fenced-frame/webrtc-peer-connection.https.html - WPT Dashboard Interop Dashboard
<!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 {
// 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>