Title: [215788] trunk/LayoutTests
Revision
215788
Author
commit-qu...@webkit.org
Date
2017-04-25 21:24:21 -0700 (Tue, 25 Apr 2017)

Log Message

fast/mediastream/RTCPeerConnection-icecandidate-event.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=171242

Patch by Youenn Fablet <you...@apple.com> on 2017-04-25
Reviewed by Alex Christensen.

* TestExpectations:
* fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt:
* fast/mediastream/RTCPeerConnection-icecandidate-event.html: Updating test to be more deterministic.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (215787 => 215788)


--- trunk/LayoutTests/ChangeLog	2017-04-26 02:26:05 UTC (rev 215787)
+++ trunk/LayoutTests/ChangeLog	2017-04-26 04:24:21 UTC (rev 215788)
@@ -1,3 +1,14 @@
+2017-04-25  Youenn Fablet  <you...@apple.com>
+
+        fast/mediastream/RTCPeerConnection-icecandidate-event.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=171242
+
+        Reviewed by Alex Christensen.
+
+        * TestExpectations:
+        * fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt:
+        * fast/mediastream/RTCPeerConnection-icecandidate-event.html: Updating test to be more deterministic.
+
 2017-04-25  Brent Fulgham  <bfulg...@apple.com>
 
         Relax the event firing ASSERT for Attr changes

Modified: trunk/LayoutTests/TestExpectations (215787 => 215788)


--- trunk/LayoutTests/TestExpectations	2017-04-26 02:26:05 UTC (rev 215787)
+++ trunk/LayoutTests/TestExpectations	2017-04-26 04:24:21 UTC (rev 215788)
@@ -733,7 +733,6 @@
 fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html [ Skip ]
 fast/mediastream/RTCPeerConnection-overloaded-operations-params.html [ Skip ]
 fast/mediastream/RTCRtpSender-replaceTrack.html [ Skip ]
-fast/mediastream/RTCPeerConnection-icecandidate-event.html [ Pass Failure ]
 fast/mediastream/RTCPeerConnection-dtmf.html [ Failure ]
 # libwebrtc backend doesn't generate a=bundle-only lines
 fast/mediastream/RTCPeerConnection-inspect-offer-bundlePolicy-bundle-only.html [ Failure ]

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt (215787 => 215788)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt	2017-04-26 02:26:05 UTC (rev 215787)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt	2017-04-26 04:24:21 UTC (rev 215788)
@@ -3,25 +3,25 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS Got candidate
-PASS event.candidate instanceof RTCIceCandidate is true
-PASS event.candidate.sdpMLineIndex is 0
-FAIL event.candidate.sdpMid should be null (of type object). Was 1 (of type string).
-PASS event.candidate.candidate: 2013266431 1 udp 2013266432 192.168.0.100 38838 typ host generation 0
 PASS Local description set
 PASS End of test promise chain
 PASS Got candidate
-PASS event.candidate instanceof RTCIceCandidate is true
-PASS event.candidate.sdpMLineIndex is 0
-FAIL event.candidate.sdpMid should be null (of type object). Was 1 (of type string).
-PASS event.candidate.candidate: 1019216383 1 tcp 1019216384 192.168.0.100 9 typ host tcptype passive generation 0
+PASS candidate instanceof RTCIceCandidate is true
+PASS candidate.sdpMLineIndex is 0
+FAIL candidate.sdpMid should be null (of type object). Was 1 (of type string).
+PASS candidate.candidate: 2013266431 1 udp 2013266432 192.168.0.100 38838 typ host generation 0
 PASS Got candidate
-PASS event.candidate instanceof RTCIceCandidate is true
-PASS event.candidate.sdpMLineIndex is 0
-FAIL event.candidate.sdpMid should be null (of type object). Was 1 (of type string).
-PASS event.candidate.candidate: 1677722111 1 tcp 1677722112 172.18.0.1 47989 typ srflx raddr 192.168.0.100 rport 47989 generation 0
+PASS candidate instanceof RTCIceCandidate is true
+PASS candidate.sdpMLineIndex is 0
+FAIL candidate.sdpMid should be null (of type object). Was 1 (of type string).
+PASS candidate.candidate: 1019216383 1 tcp 1019216384 192.168.0.100 9 typ host tcptype passive generation 0
+PASS Got candidate
+PASS candidate instanceof RTCIceCandidate is true
+PASS candidate.sdpMLineIndex is 0
+FAIL candidate.sdpMid should be null (of type object). Was 1 (of type string).
+PASS candidate.candidate: 1677722111 1 tcp 1677722112 172.18.0.1 47989 typ srflx raddr 192.168.0.100 rport 47989 generation 0
 PASS Got end of candidates
-PASS event.candidate is null
+PASS candidate is null
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event.html (215787 => 215788)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event.html	2017-04-26 02:26:05 UTC (rev 215787)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event.html	2017-04-26 04:24:21 UTC (rev 215788)
@@ -6,8 +6,6 @@
     </head>
     <body>
         <script>
-            let event;
-
             description("Test RTCPeerConnection 'icecandidate' event and gathering done");
 
             if (window.internals)
@@ -22,34 +20,47 @@
 
             const pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]});
 
+            var candidates = [];
+            var shouldDoChecking = false;
+            var reachedEndOfCandidates = false;
             pc._onicecandidate_ = function (evt) {
-                event = evt;
-                if (evt.candidate) {
+                candidates.push(evt.candidate);
+                if (!evt.candidate)
+                    reachedEndOfCandidates = true;
+                checkCandidates();
+            };
+
+            function checkCandidates() {
+              if (!shouldDoChecking || !reachedEndOfCandidates)
+                return;
+              for (candidate of candidates) {
+                if (candidate) {
                     testPassed("Got candidate");
-                    shouldBeTrue("event.candidate instanceof RTCIceCandidate");
-                    shouldBe("event.candidate.sdpMLineIndex", "0");
-                    shouldBe("event.candidate.sdpMid", "pc.getTransceivers()[0].mid");
-                    testPassed(`event.candidate.candidate: ${event.candidate.candidate}`);
+                    shouldBeTrue("candidate instanceof RTCIceCandidate");
+                    shouldBe("candidate.sdpMLineIndex", "0");
+                    shouldBe("candidate.sdpMid", "pc.getTransceivers()[0].mid");
+                    testPassed(`candidate.candidate: ${candidate.candidate}`);
                 } else {
                     testPassed("Got end of candidates");
-                    shouldBeNull("event.candidate");
-                    finishJSTest();
+                    shouldBeNull("candidate");
                 }
-            };
+              }
+              finishJSTest();
+            }
 
             navigator.mediaDevices.getUserMedia({ "video": true }).then(function (stream) {
                 pc.addTrack(stream.getTracks()[0], stream);
                 return pc.createOffer();
-            })
-            .then(function (offer) {
+            }).then(function (offer) {
                 return pc.setLocalDescription(offer);
-            })
-            .then(function () {
+            }).then(function () {
                 testPassed("Local description set");
-                window.internals.emulateRTCPeerConnectionPlatformEvent(pc, "dispatch-fake-ice-candidates");
                 testPassed("End of test promise chain");
-            })
-            .catch(function (error) {
+                if (window.internals)
+                    window.internals.emulateRTCPeerConnectionPlatformEvent(pc, "dispatch-fake-ice-candidates");
+                shouldDoChecking = true;
+                checkCandidates();
+            }).catch(function (error) {
                 testFailed("Error in promise chain: " + error);
                 finishJSTest();
             });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to