blob: 7101e6d1f36e7a636d3f07114f7a05aaa6c33ea3 [file] [log] [blame]
<!doctype html>
<html>
<body>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
test(() => {
var frame = document.createElement("iframe");
frame.setAttribute("src", "/");
document.body.appendChild(frame);
var constructor = frame.contentWindow.RTCPeerConnection;
document.body.removeChild(frame);
assert_throws('NotSupportedError', () => { new constructor() });
}, "Peer Connection objects should not be created in detached documents");
test(() => {
var frame = document.createElement("iframe");
frame.setAttribute("src", "/");
document.body.appendChild(frame);
var pc = new frame.contentWindow.RTCPeerConnection();
document.body.removeChild(frame);
assert_throws('InvalidStateError', () => { pc.setConfiguration({}) });
}, "Peer Connection objects should not be created in detached documents");
</script>
</body>
</html>