RTCTrackEvent.track should be found in RTCTrackEvent.streams[0]
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 03:12:47 +0000 (03:12 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jun 2017 03:12:47 +0000 (03:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173074

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-07
Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated test.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::addTrackFromPlatform):

LayoutTests:

* webrtc/video.html:

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

LayoutTests/ChangeLog
LayoutTests/webrtc/video.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStream.cpp

index 4915442..c740a35 100644 (file)
@@ -1,3 +1,12 @@
+2017-06-07  Youenn Fablet  <youenn@apple.com>
+
+        RTCTrackEvent.track should be found in RTCTrackEvent.streams[0]
+        https://bugs.webkit.org/show_bug.cgi?id=173074
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/video.html:
+
 2017-06-07  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Add ContextMenu item to log WebSocket object to console
index 3bb3b69..766a6db 100644 (file)
@@ -55,6 +55,7 @@ promise_test((test) => {
                     assert_true(Array.isArray(trackEvent.streams), "Array.isArray() should return true");
                     assert_true(Object.isFrozen(trackEvent.streams), "Object.isFrozen() should return true");
                     assert_equals(trackEvent.track.id, stream.getVideoTracks()[0].id);
+                    assert_equals(trackEvent.track, trackEvent.streams[0].getVideoTracks()[0]);
                     resolve(trackEvent.streams[0]);
                 };
             });
index 2b9e314..b50bfb0 100644 (file)
@@ -1,3 +1,15 @@
+2017-06-07  Youenn Fablet  <youenn@apple.com>
+
+        RTCTrackEvent.track should be found in RTCTrackEvent.streams[0]
+        https://bugs.webkit.org/show_bug.cgi?id=173074
+
+        Reviewed by Eric Carlson.
+
+        Covered by updated test.
+
+        * Modules/mediastream/MediaStream.cpp:
+        (WebCore::MediaStream::addTrackFromPlatform):
+
 2017-06-07  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: Add ContextMenu item to log WebSocket object to console
index 73f2414..0328f44 100644 (file)
@@ -220,8 +220,9 @@ void MediaStream::didRemoveTrack(MediaStreamTrackPrivate& trackPrivate)
 
 void MediaStream::addTrackFromPlatform(Ref<MediaStreamTrack>&& track)
 {
-    m_private->addTrack(&track->privateTrack(), MediaStreamPrivate::NotifyClientOption::Notify);
+    auto* privateTrack = &track->privateTrack();
     internalAddTrack(WTFMove(track), StreamModifier::Platform);
+    m_private->addTrack(privateTrack, MediaStreamPrivate::NotifyClientOption::Notify);
 }
 
 bool MediaStream::internalAddTrack(Ref<MediaStreamTrack>&& trackToAdd, StreamModifier streamModifier)