commit c8fc75101bdc7b52d894d7ccc895080e3ee5208e
parent b913a5c92a973439ce0ef4c795c2f18086447427
Author: Byron Campen <docfaraday@gmail.com>
Date: Wed, 29 Oct 2025 12:35:16 +0000
Bug 1988096: Miscellaneous test cleanup. r=jib
Add some missing test case cleanup, mark a test as long, use promise_test instead of async_test in one place.
Differential Revision: https://phabricator.services.mozilla.com/D269065
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/testing/web-platform/tests/webrtc/RTCDataChannel-id.html b/testing/web-platform/tests/webrtc/RTCDataChannel-id.html
@@ -1,5 +1,6 @@
<!doctype html>
<meta charset=utf-8>
+<meta name="timeout" content="long">
<title>RTCDataChannel id attribute</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
diff --git a/testing/web-platform/tests/webrtc/RTCDataChannel-send.html b/testing/web-platform/tests/webrtc/RTCDataChannel-send.html
@@ -56,6 +56,7 @@ const unicodeBuffer = Uint8Array.of(
*/
test(t => {
const pc = new RTCPeerConnection();
+ t.add_cleanup(() => pc.close());
const channel = pc.createDataChannel('test');
assert_equals(channel.readyState, 'connecting');
assert_throws_dom('InvalidStateError', () => channel.send(helloString));
@@ -277,7 +278,7 @@ for (const options of [{}, {negotiated: true, id: 0}]) {
}, `${mode} binaryType should receive message as ArrayBuffer by default`);
// Test sending 3 messages: helloBuffer, unicodeString, helloBlob
- async_test(t => {
+ promise_test(t => {
const receivedMessages = [];
const onMessage = t.step_func(event => {
@@ -338,6 +339,8 @@ for (const options of [{}, {negotiated: true, id: 0}]) {
// instead of its own thing.
const pc1 = new RTCPeerConnection({bundlePolicy: 'balanced'});
const pc2 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ t.add_cleanup(() => pc2.close());
pc1.addTransceiver('audio');
pc1.addTransceiver('video');
const channel1 = pc1.createDataChannel('foo1', {id: 1, ordered: false, negotiated: true});
@@ -429,9 +432,11 @@ for (const options of [{}, {negotiated: true, id: 0}]) {
await receivedMessages;
}, `Sending multiple messages simultaneously in unordered mode works reliably`);
-promise_test(async () => {
+promise_test(async t => {
const offerer = new RTCPeerConnection();
const answerer = new RTCPeerConnection();
+ t.add_cleanup(() => offerer.close());
+ t.add_cleanup(() => answerer.close());
const channel1 = offerer.createDataChannel('foo');
const toSend = [];