blob: 9fecf22548116a4b9282df5552472a8b461ec8de [file] [log] [blame]
youenn@apple.com734fdaa2018-04-24 20:22:51 +00001<!doctype html>
2<html>
3<body>
4<script src="../resources/testharness.js"></script>
5<script src="../resources/testharnessreport.js"></script>
6<script>
7test(() => {
8 var frame = document.createElement("iframe");
9 frame.setAttribute("src", "/");
10 document.body.appendChild(frame);
11 var constructor = frame.contentWindow.RTCPeerConnection;
12 document.body.removeChild(frame);
13 assert_throws('NotSupportedError', () => { new constructor() });
14}, "Peer Connection objects should not be created in detached documents");
15test(() => {
16 var frame = document.createElement("iframe");
17 frame.setAttribute("src", "/");
18 document.body.appendChild(frame);
19 var pc = new frame.contentWindow.RTCPeerConnection();
20 document.body.removeChild(frame);
21 assert_throws('InvalidStateError', () => { pc.setConfiguration({}) });
cdumez@apple.com9631a4f2019-09-16 21:04:08 +000022}, "Peer Connection objects should not be created in detached documents 2");
youenn@apple.com734fdaa2018-04-24 20:22:51 +000023</script>
24</body>
25</html>