youenn@apple.com | 734fdaa | 2018-04-24 20:22:51 +0000 | [diff] [blame] | 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({}) }); |
cdumez@apple.com | 9631a4f | 2019-09-16 21:04:08 +0000 | [diff] [blame] | 22 | }, "Peer Connection objects should not be created in detached documents 2"); |
youenn@apple.com | 734fdaa | 2018-04-24 20:22:51 +0000 | [diff] [blame] | 23 | </script> |
| 24 | </body> |
| 25 | </html> |