Commit f62a5a96 authored by Philipp Hancke's avatar Philipp Hancke Committed by Commit Bot

webrtc wpt: add missing pc.close during cleanup

running the html.js/codemod-peerconnection-addcleanup from the tools directory showed some places where a pc.close was missing

BUG=836871

Change-Id: I135db200a4269eccfafc43217b66584603101434
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1610767
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661283}
parent 3d92bf74
......@@ -42,9 +42,10 @@
iframe.contentWindow.postMessage(certificate, "*");
let certificate2 = await promise;
new RTCPeerConnection({certificates: [certificate]});
new RTCPeerConnection({certificates: [certificate2]});
const pc1 = new RTCPeerConnection({certificates: [certificate]});
t.add_cleanup(() => pc1.close());
const pc2 = new RTCPeerConnection({certificates: [certificate2]});
t.add_cleanup(() => pc2.close());
assert_equals(certificate.expires, certificate2.expires);
for (let fingerprint of certificate2.getFingerprints())
......
......@@ -300,6 +300,7 @@
promise_test(async t => {
let pc1 = new RTCPeerConnection();
t.add_cleanup(() => pc1.close());
let [channel1, channel2] = await createDataChannelPair(pc1);
let message = 'hello888'; // 8 bytes
while (message.length <= pc1.sctp.maxMessageSize) {
......
......@@ -98,7 +98,7 @@ promise_test(async t => {
iceTransport.gather({});
let candidate;
do {
({ candidate } = await watcher.wait_for('icecandidate'));
(({ candidate } = await watcher.wait_for('icecandidate')));
} while (candidate !== null);
assert_equals(iceTransport.gatheringState, 'gathering');
await watcher.wait_for('gatheringstatechange');
......
......@@ -125,6 +125,7 @@
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const offer = await pc.createOffer();
let eventSequence = '';
const signalingstatechangeResolver = new Resolver();
......
......@@ -63,6 +63,7 @@
*/
promise_test(async t => {
const pc = new RTCPeerConnection();
t.add_cleanup(() => pc.close());
const { sender } = pc.addTransceiver('audio');
await doOfferAnswerExchange(t, pc);
......@@ -73,7 +74,6 @@
validateSenderRtpParameters(param2);
assert_not_equals(param1.transactionId, param2.transactionId);
}, `sender.getParameters() should return different transaction IDs for each call`);
/*
......
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