LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2018 08:59:44 +0000 (08:59 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 Oct 2018 08:59:44 +0000 (08:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191026

Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):

LayoutTests:

* webrtc/video-addTransceiver-expected.txt:
* webrtc/video-addTransceiver.html:

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

LayoutTests/ChangeLog
LayoutTests/webrtc/video-addTransceiver-expected.txt
LayoutTests/webrtc/video-addTransceiver.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp

index e2dc9a8..a4f5e0f 100644 (file)
@@ -1,3 +1,13 @@
+2018-10-30  Youenn Fablet  <youenn@apple.com>
+
+        LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
+        https://bugs.webkit.org/show_bug.cgi?id=191026
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/video-addTransceiver-expected.txt:
+        * webrtc/video-addTransceiver.html:
+
 2018-10-29  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: refactor code for getting properties via WI.RemoteObject
index 8790e6b..c2ce510 100644 (file)
@@ -3,4 +3,5 @@
 PASS Setting up calls with addTransceiver but with no track 
 PASS Setting up calls with addTransceiver with a track 
 PASS Basic video exchange set up with addTransceiver 
+PASS Testing synchronization sources 
 
index 42c7c99..ccfa72a 100644 (file)
@@ -87,6 +87,36 @@ promise_test(async (test) => {
     testImage();
 }, "Basic video exchange set up with addTransceiver");
 
+promise_test(async (test) => {
+    let receivingConnection;
+    if (window.testRunner)
+        testRunner.setUserMediaPermission(true);
+
+    const stream = await navigator.mediaDevices.getUserMedia({audio: true, video: true});
+
+    const remoteStream = await new Promise((resolve, reject) => {
+        createConnections((firstConnection) => {
+            firstConnection.addTrack(stream.getAudioTracks()[0], stream);
+            firstConnection.addTrack(stream.getVideoTracks()[0], stream);
+        }, (secondConnection) => {
+            secondConnection.ontrack = (trackEvent) => {
+                resolve(trackEvent.streams[0]);
+            };
+            receivingConnection = secondConnection;
+        });
+        setTimeout(() => reject("Test timed out"), 5000);
+    });
+
+    video.srcObject = remoteStream;
+    await video.play();
+
+    const sources = receivingConnection.getReceivers()[0].getSynchronizationSources();
+    if (sources.length) {
+        assert_true(!!sources[0].audioLevel, "audioLevel");
+        assert_true(!!sources[0].source, "source");
+        assert_true(!!sources[0].timestamp, "timestamp");
+    }
+}, "Testing synchronization sources");
         </script>
     </body>
 </html>
index 13d3418..e8657f1 100644 (file)
@@ -1,3 +1,15 @@
+2018-10-30  Youenn Fablet  <youenn@apple.com>
+
+        LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
+        https://bugs.webkit.org/show_bug.cgi?id=191026
+
+        Reviewed by Eric Carlson.
+
+        Covered by updated test.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
+        (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
+
 2018-10-30  Claudio Saavedra  <csaavedra@igalia.com>
 
         [GTK][WPE] Fixes to the PublicSuffix implementation
index 6a0beb3..f5a6ecf 100644 (file)
@@ -73,7 +73,7 @@ Vector<RTCRtpSynchronizationSource> LibWebRTCRtpReceiverBackend::getSynchronizat
     Vector<RTCRtpSynchronizationSource> sources;
     for (auto& rtcSource : m_rtcReceiver->GetSources()) {
         if (rtcSource.source_type() == webrtc::RtpSourceType::SSRC)
-            sources.uncheckedAppend(toRTCRtpSynchronizationSource(rtcSource));
+            sources.append(toRTCRtpSynchronizationSource(rtcSource));
     }
     return sources;
 }