blob: 5f89a58fa59f90084d4bdda288173a04e7d35bd4 [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing basic data channel and garbage collection</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<script src ="../routines.js"></script>
<script>
var finishTest;
promise_test((test) => {
counter = 0;
return new Promise((resolve, reject) => {
createConnections((localConnection) => {
localConnection.createDataChannel('sendDataChannel').onclose = resolve;
}, (remoteConnection) => {
remoteConnection.ondatachannel = (event) => {
var remoteChannel = event.channel;
remoteChannel.close();
};
});
if (window.GCController)
return GCController.collect();
}).then(() => {
closeConnections();
});
}, "Losing local channel reference and closing it on the other side should still allow emitting the close event");
</script>
</body>
</html>