Title: [155199] trunk
Revision
155199
Author
[email protected]
Date
2013-09-06 11:28:54 -0700 (Fri, 06 Sep 2013)

Log Message

[MediaStream API] Allow empty MediaStreams
https://bugs.webkit.org/show_bug.cgi?id=120815

Reviewed by Jer Noble.

The spec is a bit unclear ecactly what should happen with newly created MediaStreams
that doesn't have any tracks. The current implementation is too strict and the spec
is being worked upon to be clearer. In the meantime this patch doesn't set eneded to
true in the constructor.

Source/WebCore:

No new tests, existing test updated.

(WebCore::MediaStreamRegistry::lookupMediaStreamDescriptor):
* platform/mediastream/MediaStreamDescriptor.h:
(WebCore::MediaStreamDescriptor::MediaStreamDescriptor):

LayoutTests:

* fast/mediastream/MediaStreamConstructor-expected.txt:
* fast/mediastream/MediaStreamConstructor.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (155198 => 155199)


--- trunk/LayoutTests/ChangeLog	2013-09-06 18:21:35 UTC (rev 155198)
+++ trunk/LayoutTests/ChangeLog	2013-09-06 18:28:54 UTC (rev 155199)
@@ -1,3 +1,18 @@
+2013-09-06  Eric Carlson  <[email protected]>
+
+        [MediaStream API] Allow empty MediaStreams
+        https://bugs.webkit.org/show_bug.cgi?id=120815
+
+        Reviewed by Jer Noble.
+
+        The spec is a bit unclear ecactly what should happen with newly created MediaStreams 
+        that doesn't have any tracks. The current implementation is too strict and the spec 
+        is being worked upon to be clearer. In the meantime this patch doesn't set eneded to 
+        true in the constructor. 
+
+        * fast/mediastream/MediaStreamConstructor-expected.txt:
+        * fast/mediastream/MediaStreamConstructor.html:
+
 2013-09-06  Denis Nomiyama  <[email protected]>
 
         [GTK] AccessibilityUIElement::addNotificationListener() crashes on debug build

Modified: trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt (155198 => 155199)


--- trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt	2013-09-06 18:21:35 UTC (rev 155198)
+++ trunk/LayoutTests/fast/mediastream/MediaStreamConstructor-expected.txt	2013-09-06 18:28:54 UTC (rev 155199)
@@ -21,7 +21,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is true
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -29,7 +28,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is true
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -37,7 +35,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is false
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -45,7 +42,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is false
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -53,7 +49,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is false
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -61,7 +56,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is false
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -69,7 +63,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is false
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -77,7 +70,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is true
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -85,7 +77,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is true
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -93,7 +84,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is true
 PASS checkIdAttribute(newStream.id) is true
 PASS Stream constructed
 PASS [object MediaStream] is non-null.
@@ -101,7 +91,6 @@
 PASS newStream.constructor.name is 'MediaStream'
 PASS newStream.getAudioTracks().length is nAudio
 PASS newStream.getVideoTracks().length is nVideo
-PASS newStream.ended is true
 PASS checkIdAttribute(newStream.id) is true
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/fast/mediastream/MediaStreamConstructor.html (155198 => 155199)


--- trunk/LayoutTests/fast/mediastream/MediaStreamConstructor.html	2013-09-06 18:21:35 UTC (rev 155198)
+++ trunk/LayoutTests/fast/mediastream/MediaStreamConstructor.html	2013-09-06 18:28:54 UTC (rev 155199)
@@ -76,21 +76,21 @@
     shouldThrow('new webkitMediaStream(null)');
     shouldThrow('new webkitMediaStream(undefined)');
 
-    verifyStream(new webkitMediaStream(), 0, 0, true);
-    verifyStream(new webkitMediaStream([]), 0, 0, true);
+    verifyStream(new webkitMediaStream(), 0, 0);
+    verifyStream(new webkitMediaStream([]), 0, 0);
 
-    verifyStream(new webkitMediaStream(s), s.getAudioTracks().length, s.getVideoTracks().length, false);
+    verifyStream(new webkitMediaStream(s), s.getAudioTracks().length, s.getVideoTracks().length);
 
-    verifyStream(new webkitMediaStream([s.getAudioTracks()[0]]), 1, 0, false);
-    verifyStream(new webkitMediaStream([s.getVideoTracks()[0]]), 0, 1, false);
-    verifyStream(new webkitMediaStream([s.getAudioTracks()[0], s.getVideoTracks()[0]]), 1, 1, false);
-    verifyStream(new webkitMediaStream([s.getVideoTracks()[0], s.getAudioTracks()[0], s.getVideoTracks()[0]]), 1, 1, false);
+    verifyStream(new webkitMediaStream([s.getAudioTracks()[0]]), 1, 0);
+    verifyStream(new webkitMediaStream([s.getVideoTracks()[0]]), 0, 1);
+    verifyStream(new webkitMediaStream([s.getAudioTracks()[0], s.getVideoTracks()[0]]), 1, 1);
+    verifyStream(new webkitMediaStream([s.getVideoTracks()[0], s.getAudioTracks()[0], s.getVideoTracks()[0]]), 1, 1);
 
     s._onended_ = function () {
-        verifyStream(new webkitMediaStream([s.getAudioTracks()[0]]), 0, 0, true);
-        verifyStream(new webkitMediaStream([s.getVideoTracks()[0]]), 0, 0, true);
-        verifyStream(new webkitMediaStream([s.getAudioTracks()[0], s.getVideoTracks()[0]]), 0, 0, true);
-        verifyStream(new webkitMediaStream(s), 0, 0, true);
+        verifyStream(new webkitMediaStream([s.getAudioTracks()[0]]), 0, 0);
+        verifyStream(new webkitMediaStream([s.getVideoTracks()[0]]), 0, 0);
+        verifyStream(new webkitMediaStream([s.getAudioTracks()[0], s.getVideoTracks()[0]]), 0, 0);
+        verifyStream(new webkitMediaStream(s), 0, 0);
 
         finishJSTest();
     };
@@ -98,7 +98,7 @@
     s.stop();
 }
 
-function verifyStream(s, numAudioTracks, numVideoTracks, ended) {
+function verifyStream(s, numAudioTracks, numVideoTracks) {
     newStream = s;
     nAudio = numAudioTracks;
     nVideo = numVideoTracks;
@@ -110,11 +110,6 @@
     shouldBe('newStream.getAudioTracks().length', 'nAudio');
     shouldBe('newStream.getVideoTracks().length', 'nVideo');
 
-    if (ended)
-        shouldBeTrue('newStream.ended');
-    else
-        shouldBeFalse('newStream.ended');
-
     shouldBeTrue('checkIdAttribute(newStream.id)');
 }
 

Modified: trunk/Source/WebCore/ChangeLog (155198 => 155199)


--- trunk/Source/WebCore/ChangeLog	2013-09-06 18:21:35 UTC (rev 155198)
+++ trunk/Source/WebCore/ChangeLog	2013-09-06 18:28:54 UTC (rev 155199)
@@ -1,3 +1,21 @@
+2013-09-06  Eric Carlson  <[email protected]>
+
+        [MediaStream API] Allow empty MediaStreams
+        https://bugs.webkit.org/show_bug.cgi?id=120815
+
+        Reviewed by Jer Noble.
+
+        The spec is a bit unclear ecactly what should happen with newly created MediaStreams 
+        that doesn't have any tracks. The current implementation is too strict and the spec 
+        is being worked upon to be clearer. In the meantime this patch doesn't set eneded to 
+        true in the constructor. 
+
+        No new tests, existing test updated.
+
+        (WebCore::MediaStreamRegistry::lookupMediaStreamDescriptor):
+        * platform/mediastream/MediaStreamDescriptor.h:
+        (WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
+
 2013-09-06  Anders Carlsson  <[email protected]>
 
         Stop using fastNew/fastDelete in WebCore

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h (155198 => 155199)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h	2013-09-06 18:21:35 UTC (rev 155198)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamDescriptor.h	2013-09-06 18:28:54 UTC (rev 155199)
@@ -109,9 +109,6 @@
 
         for (size_t i = 0; i < videoSources.size(); i++)
             m_videoComponents.append(MediaStreamComponent::create(this, videoSources[i]));
-
-        if (!audioSources.size() && !videoSources.size())
-            m_ended = true;
     }
 
     MediaStreamDescriptor(const String& id, const MediaStreamComponentVector& audioComponents, const MediaStreamComponentVector& videoComponents)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to