Make mDNS ICE Candidate an experimental flag again
[WebKit-https.git] / LayoutTests / webrtc / pc-detached-document.html
1 <!doctype html>
2 <html>
3 <body>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script>
7 test(() => {
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");
15 test(() => {
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({}) });
22 }, "Peer Connection objects should not be created in detached documents");
23 </script>
24 </body>
25 </html>