Title: [126779] trunk
Revision
126779
Author
[email protected]
Date
2012-08-27 11:54:15 -0700 (Mon, 27 Aug 2012)

Log Message

MediaStream API: Fix review comments from patch #93119
https://bugs.webkit.org/show_bug.cgi?id=95064

Reviewed by Adam Barth.

Source/WebCore:

Adding const to accessors.

Change covered by exisiting tests..

* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::candidate):
(WebCore::RTCIceCandidate::sdpMid):
(WebCore::RTCIceCandidate::sdpMLineIndex):
* Modules/mediastream/RTCIceCandidate.h:
(RTCIceCandidate):
* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::create):
(WebCore::RTCSessionDescription::type):
(WebCore::RTCSessionDescription::sdp):
* Modules/mediastream/RTCSessionDescription.h:
(RTCSessionDescription):

LayoutTests:

* fast/mediastream/RTCIceCandidate-expected.txt:
* fast/mediastream/RTCIceCandidate.html:
* fast/mediastream/RTCSessionDescription-expected.txt:
* fast/mediastream/RTCSessionDescription.html:
* fast/mediastream/constructors-expected.txt:
* fast/mediastream/constructors.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (126778 => 126779)


--- trunk/LayoutTests/ChangeLog	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/LayoutTests/ChangeLog	2012-08-27 18:54:15 UTC (rev 126779)
@@ -1,3 +1,17 @@
+2012-08-27  Tommy Widenflycht  <[email protected]>
+
+        MediaStream API: Fix review comments from patch #93119
+        https://bugs.webkit.org/show_bug.cgi?id=95064
+
+        Reviewed by Adam Barth.
+
+        * fast/mediastream/RTCIceCandidate-expected.txt:
+        * fast/mediastream/RTCIceCandidate.html:
+        * fast/mediastream/RTCSessionDescription-expected.txt:
+        * fast/mediastream/RTCSessionDescription.html:
+        * fast/mediastream/constructors-expected.txt:
+        * fast/mediastream/constructors.html:
+
 2012-08-27  Simon Fraser  <[email protected]>
 
         Fix sticky-position test to hide scrollbars.

Modified: trunk/LayoutTests/fast/mediastream/RTCIceCandidate-expected.txt (126778 => 126779)


--- trunk/LayoutTests/fast/mediastream/RTCIceCandidate-expected.txt	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/LayoutTests/fast/mediastream/RTCIceCandidate-expected.txt	2012-08-27 18:54:15 UTC (rev 126779)
@@ -7,6 +7,7 @@
 PASS candidate.candidate is "foo"
 PASS candidate.sdpMid is "bar"
 PASS candidate.sdpMLineIndex is 6
+PASS initializer = JSON.parse(JSON.stringify(candidate)); did not throw exception.
 PASS candidate = new RTCIceCandidate(initializer); did not throw exception.
 PASS candidate.candidate is "foo"
 PASS candidate.sdpMid is "bar"

Modified: trunk/LayoutTests/fast/mediastream/RTCIceCandidate.html (126778 => 126779)


--- trunk/LayoutTests/fast/mediastream/RTCIceCandidate.html	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/LayoutTests/fast/mediastream/RTCIceCandidate.html	2012-08-27 18:54:15 UTC (rev 126779)
@@ -17,7 +17,8 @@
 shouldBe('candidate.sdpMid', '"bar"');
 shouldBe('candidate.sdpMLineIndex', '6');
 
-initializer = JSON.parse(JSON.stringify(candidate));
+shouldNotThrow('initializer = JSON.parse(JSON.stringify(candidate));');
+
 shouldNotThrow('candidate = new RTCIceCandidate(initializer);');
 shouldBe('candidate.candidate', '"foo"');
 shouldBe('candidate.sdpMid', '"bar"');

Modified: trunk/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt (126778 => 126779)


--- trunk/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt	2012-08-27 18:54:15 UTC (rev 126779)
@@ -6,6 +6,7 @@
 PASS sessionDescription = new RTCSessionDescription(initializer); did not throw exception.
 PASS sessionDescription.type is "offer"
 PASS sessionDescription.sdp is "foobar"
+PASS initializer = JSON.parse(JSON.stringify(sessionDescription)); did not throw exception.
 PASS sessionDescription = new RTCSessionDescription(initializer); did not throw exception.
 PASS sessionDescription.type is "offer"
 PASS sessionDescription.sdp is "foobar"

Modified: trunk/LayoutTests/fast/mediastream/RTCSessionDescription.html (126778 => 126779)


--- trunk/LayoutTests/fast/mediastream/RTCSessionDescription.html	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/LayoutTests/fast/mediastream/RTCSessionDescription.html	2012-08-27 18:54:15 UTC (rev 126779)
@@ -16,7 +16,8 @@
 shouldBe('sessionDescription.type', '"offer"');
 shouldBe('sessionDescription.sdp', '"foobar"');
 
-initializer = JSON.parse(JSON.stringify(sessionDescription));
+shouldNotThrow('initializer = JSON.parse(JSON.stringify(sessionDescription));');
+
 shouldNotThrow("sessionDescription = new RTCSessionDescription(initializer);");
 shouldBe('sessionDescription.type', '"offer"');
 shouldBe('sessionDescription.sdp', '"foobar"');

Modified: trunk/LayoutTests/fast/mediastream/constructors-expected.txt (126778 => 126779)


--- trunk/LayoutTests/fast/mediastream/constructors-expected.txt	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/LayoutTests/fast/mediastream/constructors-expected.txt	2012-08-27 18:54:15 UTC (rev 126779)
@@ -6,13 +6,21 @@
 PASS typeof webkitPeerConnection00 === 'function' is true
 PASS typeof SessionDescription === 'function' is true
 PASS typeof IceCandidate === 'function' is true
+PASS typeof webkitRTCPeerConnection === 'function' is true
+PASS typeof RTCSessionDescription === 'function' is true
+PASS typeof RTCIceCandidate === 'function' is true
+PASS webkitPeerConnection00() threw exception TypeError: DOM object constructor cannot be called as a function..
+PASS SessionDescription() threw exception TypeError: DOM object constructor cannot be called as a function..
+PASS IceCandidate() threw exception TypeError: DOM object constructor cannot be called as a function..
+PASS webkitRTCPeerConnection() threw exception TypeError: DOM object constructor cannot be called as a function..
+PASS RTCSessionDescription() threw exception TypeError: DOM object constructor cannot be called as a function..
+PASS RTCIceCandidate() threw exception TypeError: DOM object constructor cannot be called as a function..
 PASS new webkitPeerConnection00('STUN foobar.com:12345', function(){}); did not throw exception.
-PASS new webkitPeerConnection00('STUN foobar.com:12345'); threw exception TypeError: Not enough arguments.
-PASS new webkitPeerConnection00('STUN foobar.com:12345', null); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS new webkitPeerConnection00('STUN foobar.com:12345', undefined); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
-PASS new webkitPeerConnection00('STUN foobar.com:12345', 'STUN'); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
 PASS new SessionDescription(''); did not throw exception.
 PASS new IceCandidate('', ''); did not throw exception.
+PASS new webkitRTCPeerConnection({iceServers:[{uri:'stun://foobar.com:12345'}]}, null); did not throw exception.
+PASS new RTCSessionDescription({type:'offer',sdp:'foobar'}); did not throw exception.
+PASS new RTCIceCandidate({candidate:'foo'}); did not throw exception.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/mediastream/constructors.html (126778 => 126779)


--- trunk/LayoutTests/fast/mediastream/constructors.html	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/LayoutTests/fast/mediastream/constructors.html	2012-08-27 18:54:15 UTC (rev 126779)
@@ -13,15 +13,23 @@
 shouldBeTrue("typeof webkitPeerConnection00 === 'function'");
 shouldBeTrue("typeof SessionDescription === 'function'");
 shouldBeTrue("typeof IceCandidate === 'function'");
+shouldBeTrue("typeof webkitRTCPeerConnection === 'function'");
+shouldBeTrue("typeof RTCSessionDescription === 'function'");
+shouldBeTrue("typeof RTCIceCandidate === 'function'");
 
+shouldThrow("webkitPeerConnection00()");
+shouldThrow("SessionDescription()");
+shouldThrow("IceCandidate()");
+shouldThrow("webkitRTCPeerConnection()");
+shouldThrow("RTCSessionDescription()");
+shouldThrow("RTCIceCandidate()");
+
 shouldNotThrow("new webkitPeerConnection00('STUN foobar.com:12345', function(){});");
-shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345');");
-shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345', null);");
-shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345', undefined);");
-shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345', 'STUN');");
-
 shouldNotThrow("new SessionDescription('');");
 shouldNotThrow("new IceCandidate('', '');");
+shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{uri:'stun://foobar.com:12345'}]}, null);");
+shouldNotThrow("new RTCSessionDescription({type:'offer',sdp:'foobar'});");
+shouldNotThrow("new RTCIceCandidate({candidate:'foo'});");
 
 window.jsTestIsAsync = false;
 </script>

Modified: trunk/Source/WebCore/ChangeLog (126778 => 126779)


--- trunk/Source/WebCore/ChangeLog	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/Source/WebCore/ChangeLog	2012-08-27 18:54:15 UTC (rev 126779)
@@ -1,3 +1,27 @@
+2012-08-27  Tommy Widenflycht  <[email protected]>
+
+        MediaStream API: Fix review comments from patch #93119
+        https://bugs.webkit.org/show_bug.cgi?id=95064
+
+        Reviewed by Adam Barth.
+
+        Adding const to accessors.
+
+        Change covered by exisiting tests..
+
+        * Modules/mediastream/RTCIceCandidate.cpp:
+        (WebCore::RTCIceCandidate::candidate):
+        (WebCore::RTCIceCandidate::sdpMid):
+        (WebCore::RTCIceCandidate::sdpMLineIndex):
+        * Modules/mediastream/RTCIceCandidate.h:
+        (RTCIceCandidate):
+        * Modules/mediastream/RTCSessionDescription.cpp:
+        (WebCore::RTCSessionDescription::create):
+        (WebCore::RTCSessionDescription::type):
+        (WebCore::RTCSessionDescription::sdp):
+        * Modules/mediastream/RTCSessionDescription.h:
+        (RTCSessionDescription):
+
 2012-08-27  Simon Fraser  <[email protected]>
 
         Make Force Repaint work with tiled backing store

Modified: trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp (126778 => 126779)


--- trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp	2012-08-27 18:54:15 UTC (rev 126779)
@@ -73,17 +73,17 @@
 {
 }
 
-const String& RTCIceCandidate::candidate()
+const String& RTCIceCandidate::candidate() const
 {
     return m_descriptor->candidate();
 }
 
-const String& RTCIceCandidate::sdpMid()
+const String& RTCIceCandidate::sdpMid() const
 {
     return m_descriptor->sdpMid();
 }
 
-unsigned short RTCIceCandidate::sdpMLineIndex()
+unsigned short RTCIceCandidate::sdpMLineIndex() const
 {
     return m_descriptor->sdpMLineIndex();
 }

Modified: trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h (126778 => 126779)


--- trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h	2012-08-27 18:54:15 UTC (rev 126779)
@@ -50,9 +50,9 @@
     static PassRefPtr<RTCIceCandidate> create(PassRefPtr<RTCIceCandidateDescriptor>);
     virtual ~RTCIceCandidate();
 
-    const String& candidate();
-    const String& sdpMid();
-    unsigned short sdpMLineIndex();
+    const String& candidate() const;
+    const String& sdpMid() const;
+    unsigned short sdpMLineIndex() const;
 
     RTCIceCandidateDescriptor* descriptor();
 

Modified: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp (126778 => 126779)


--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp	2012-08-27 18:54:15 UTC (rev 126779)
@@ -56,7 +56,7 @@
 
     String sdp;
     ok = dictionary.get("sdp", sdp);
-    if (!ok || !sdp.length()) {
+    if (!ok || sdp.isEmpty()) {
         ec = TYPE_MISMATCH_ERR;
         return 0;
     }
@@ -79,7 +79,7 @@
 {
 }
 
-const String& RTCSessionDescription::type()
+const String& RTCSessionDescription::type() const
 {
     return m_descriptor->type();
 }
@@ -92,7 +92,7 @@
         ec = TYPE_MISMATCH_ERR;
 }
 
-const String& RTCSessionDescription::sdp()
+const String& RTCSessionDescription::sdp() const
 {
     return m_descriptor->sdp();
 }

Modified: trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h (126778 => 126779)


--- trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h	2012-08-27 18:38:59 UTC (rev 126778)
+++ trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h	2012-08-27 18:54:15 UTC (rev 126779)
@@ -49,10 +49,10 @@
     static PassRefPtr<RTCSessionDescription> create(PassRefPtr<RTCSessionDescriptionDescriptor>);
     virtual ~RTCSessionDescription();
 
-    const String& type();
+    const String& type() const;
     void setType(const String&, ExceptionCode&);
 
-    const String& sdp();
+    const String& sdp() const;
     void setSdp(const String&, ExceptionCode&);
 
     RTCSessionDescriptionDescriptor* descriptor();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to