webrtc/addICECandidate-closed.html is timing out
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 May 2018 02:11:53 +0000 (02:11 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 May 2018 02:11:53 +0000 (02:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185336

Reviewed by Eric Carlson.

* webrtc/addICECandidate-closed.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231395 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/webrtc/addICECandidate-closed.html

index 7739568..c898d37 100644 (file)
@@ -1,3 +1,12 @@
+2018-05-04  Youenn Fablet  <youenn@apple.com>
+
+        webrtc/addICECandidate-closed.html is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=185336
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/addICECandidate-closed.html:
+
 2018-05-04  Devin Rousso  <webkit@devinrousso.com>
 
         Web Inspector: simplify the WI.Collection interface
index 2f5a6d6..57dfd16 100644 (file)
@@ -28,13 +28,21 @@ promise_test(async (test) => {
         await receiver.setRemoteDescription(offer1);
         const answer1 = await receiver.createAnswer();
         await receiver.setLocalDescription(answer1);
-        await sender.setRemoteDescription(answer1);
-        const offer2 = await sender.createOffer();
-        await sender.setLocalDescription(offer2);
-        await receiver.setRemoteDescription(offer2);
-        const answer2 = await receiver.createAnswer();
-        await receiver.setLocalDescription(answer2);
-        await sender.setRemoteDescription(answer2);
+        await new Promise (async (resolve) => {
+            // RTCPeerConnection does not resolve promises when it gets closed, hence the timeout here to make sure we execute some if not all these operations.
+            test.step_timeout(resolve, 100);
+            try {
+                await sender.setRemoteDescription(answer1);
+                const offer2 = await sender.createOffer();
+                await sender.setLocalDescription(offer2);
+                await receiver.setRemoteDescription(offer2);
+                const answer2 = await receiver.createAnswer();
+                await receiver.setLocalDescription(answer2);
+                await sender.setRemoteDescription(answer2);
+            } finally {
+                resolve();
+            }
+        });
     } catch (e) {
     }
 }, "Close a peer connection in the middle of gathering");