Commit 58b857c5 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Add a test that a PeerConnection in an iframe gets closed and collected.

Bug: none
Change-Id: Id2858339f46c14ee6b007c5e3b0aa4b2d7c90c30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153160
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762811}
parent 2469a923
<html>
<head>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/gc.js"></script>
</head>
<body>
<script>
promise_test(async t => {
let iframe = document.createElement("iframe");
document.body.appendChild( iframe );
let iframe_pc = new iframe.contentWindow.RTCPeerConnection();
assert_equals(iframe_pc.signalingState, 'stable');
iframe.remove();
assert_equals(iframe_pc.signalingState, 'closed');
assert_equals(internals.peerConnectionCount(), 1);
iframe_pc = null;
await asyncGC();
assert_equals(internals.peerConnectionCount(), 0);
}, 'PeerConnection in iframe is closed and garbage collected');
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment