Title: [295769] trunk/LayoutTests/webrtc/datachannel
Revision
295769
Author
[email protected]
Date
2022-06-22 23:35:37 -0700 (Wed, 22 Jun 2022)

Log Message

Make sure to close connections in webrtc/datachannel/mdns-ice-candidates.html
https://bugs.webkit.org/show_bug.cgi?id=241846

Patch by Youenn Fablet <[email protected]> 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

Modified Paths

Diff

Modified: trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates-expected.txt (295768 => 295769)


--- trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates-expected.txt	2022-06-23 03:45:31 UTC (rev 295768)
+++ trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates-expected.txt	2022-06-23 06:35:37 UTC (rev 295769)
@@ -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

Modified: trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates.html (295768 => 295769)


--- trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates.html	2022-06-23 03:45:31 UTC (rev 295768)
+++ trunk/LayoutTests/webrtc/datachannel/mdns-ice-candidates.html	2022-06-23 06:35:37 UTC (rev 295769)
@@ -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) => {
+promise_test(async (test) => {
+    window.logReceivedMessage = true;
+
     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");
-        };
-
+    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) => {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to