Skip to content
Permalink
Browse files
Make sure to close connections in webrtc/datachannel/mdns-ice-candida…
…tes.html

https://bugs.webkit.org/show_bug.cgi?id=241846

Patch by Youenn Fablet <youennf@gmail.com> on 2022-06-22
Reviewed by Eric Carlson.

Make sure to close connections by using await instead of return.
Add some logging to further check the failing test in bots.
Remove some unnecessary code.

* LayoutTests/webrtc/datachannel/mdns-ice-candidates-expected.txt:
* LayoutTests/webrtc/datachannel/mdns-ice-candidates.html:

Canonical link: https://commits.webkit.org/251774@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
youennf authored and webkit-commit-queue committed Jun 23, 2022
1 parent 12086bc commit 5fe6b7111edcce81c35607715861996b50f5de5c
Showing 2 changed files with 19 additions and 18 deletions.
@@ -1,3 +1,7 @@
CONSOLE MESSAGE: receiving one
CONSOLE MESSAGE: receiving two
CONSOLE MESSAGE: receiving three
CONSOLE MESSAGE: receiving four

PASS Getting some MDNS candidates
PASS Basic data channel exchange from offerer to receiver
@@ -22,6 +22,9 @@
}

function receiveMessages(event) {
if (window.logReceivedMessage)
console.log("receiving " + event.data);

try {
if (++counter === 1)
assert_equals(event.data, "one");
@@ -72,9 +75,9 @@
}, "Getting some MDNS candidates");

var finishTest;
promise_test((test) => {
promise_test(async (test) => {
counter = 0;
return new Promise((resolve, reject) => {
await new Promise((resolve, reject) => {
finishTest = resolve;
createConnections((localConnection) => {
localChannel = localConnection.createDataChannel('sendDataChannel');
@@ -90,9 +93,9 @@
closeConnections();
}, "Basic data channel exchange from offerer to receiver");

promise_test((test) => {
promise_test(async (test) => {
counter = 0;
return new Promise((resolve, reject) => {
await new Promise((resolve, reject) => {
finishTest = resolve;
createConnections((localConnection) => {
localChannel = localConnection.createDataChannel('sendDataChannel');
@@ -109,9 +112,9 @@
}, "Basic data channel exchange from receiver to offerer");


promise_test((test) => {
promise_test(async (test) => {
counter = 0;
return new Promise((resolve, reject) => {
await new Promise((resolve, reject) => {
finishTest = resolve;
createConnections((localConnection) => {
localChannel = localConnection.createDataChannel('sendDataChannel');
@@ -127,19 +130,11 @@
closeConnections();
}, "Basic data channel exchange from offerer to receiver using UDP only");

promise_test((test) => {
counter = 0;
return new Promise((resolve, reject) => {
var checkDataChannelOptions = (channel, init) => {
assert_equals(channel.ordered, init.ordered, "ordered");
assert_equals(channel.maxPacketLifeTime, init.maxPacketLifeTime, "maxPacketLifeTime");
assert_equals(channel.maxRetransmitTime, init.maxRetransmitTime, "maxRetransmitTime");
assert_equals(channel.maxRetransmits, init.maxRetransmits, "maxRetransmits");
assert_equals(channel.protocol, init.protocol, "protocol");
assert_equals(channel.negotiated, init.negotiated, "negotiated");
assert_equals(channel.id, init.id, "id");
};
promise_test(async (test) => {
window.logReceivedMessage = true;

counter = 0;
await new Promise((resolve, reject) => {
finishTest = resolve;
createConnections((localConnection) => {
var init = { ordered: true, maxPacketLifeTime: 10, maxRetransmitTime: 11, protocol: "whatever", negotiated: false, id: 1 };
@@ -154,6 +149,8 @@
setTimeout(() => { reject("Test timed out"); }, 5000);
});
closeConnections();

window.logReceivedMessage = false;
}, "Basic data channel exchange from offerer to receiver 2");

promise_test(async (test) => {

0 comments on commit 5fe6b71

Please sign in to comment.