Changeset 126779 in webkit


Ignore:
Timestamp:
Aug 27, 2012 11:54:15 AM (12 years ago)
Author:
tommyw@google.com
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:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126778 r126779  
     12012-08-27  Tommy Widenflycht  <tommyw@google.com>
     2
     3        MediaStream API: Fix review comments from patch #93119
     4        https://bugs.webkit.org/show_bug.cgi?id=95064
     5
     6        Reviewed by Adam Barth.
     7
     8        * fast/mediastream/RTCIceCandidate-expected.txt:
     9        * fast/mediastream/RTCIceCandidate.html:
     10        * fast/mediastream/RTCSessionDescription-expected.txt:
     11        * fast/mediastream/RTCSessionDescription.html:
     12        * fast/mediastream/constructors-expected.txt:
     13        * fast/mediastream/constructors.html:
     14
    1152012-08-27  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/LayoutTests/fast/mediastream/RTCIceCandidate-expected.txt

    r126328 r126779  
    88PASS candidate.sdpMid is "bar"
    99PASS candidate.sdpMLineIndex is 6
     10PASS initializer = JSON.parse(JSON.stringify(candidate)); did not throw exception.
    1011PASS candidate = new RTCIceCandidate(initializer); did not throw exception.
    1112PASS candidate.candidate is "foo"
  • trunk/LayoutTests/fast/mediastream/RTCIceCandidate.html

    r126328 r126779  
    1818shouldBe('candidate.sdpMLineIndex', '6');
    1919
    20 initializer = JSON.parse(JSON.stringify(candidate));
     20shouldNotThrow('initializer = JSON.parse(JSON.stringify(candidate));');
     21
    2122shouldNotThrow('candidate = new RTCIceCandidate(initializer);');
    2223shouldBe('candidate.candidate', '"foo"');
  • trunk/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt

    r126333 r126779  
    77PASS sessionDescription.type is "offer"
    88PASS sessionDescription.sdp is "foobar"
     9PASS initializer = JSON.parse(JSON.stringify(sessionDescription)); did not throw exception.
    910PASS sessionDescription = new RTCSessionDescription(initializer); did not throw exception.
    1011PASS sessionDescription.type is "offer"
  • trunk/LayoutTests/fast/mediastream/RTCSessionDescription.html

    r126333 r126779  
    1717shouldBe('sessionDescription.sdp', '"foobar"');
    1818
    19 initializer = JSON.parse(JSON.stringify(sessionDescription));
     19shouldNotThrow('initializer = JSON.parse(JSON.stringify(sessionDescription));');
     20
    2021shouldNotThrow("sessionDescription = new RTCSessionDescription(initializer);");
    2122shouldBe('sessionDescription.type', '"offer"');
  • trunk/LayoutTests/fast/mediastream/constructors-expected.txt

    r118586 r126779  
    77PASS typeof SessionDescription === 'function' is true
    88PASS typeof IceCandidate === 'function' is true
     9PASS typeof webkitRTCPeerConnection === 'function' is true
     10PASS typeof RTCSessionDescription === 'function' is true
     11PASS typeof RTCIceCandidate === 'function' is true
     12PASS webkitPeerConnection00() threw exception TypeError: DOM object constructor cannot be called as a function..
     13PASS SessionDescription() threw exception TypeError: DOM object constructor cannot be called as a function..
     14PASS IceCandidate() threw exception TypeError: DOM object constructor cannot be called as a function..
     15PASS webkitRTCPeerConnection() threw exception TypeError: DOM object constructor cannot be called as a function..
     16PASS RTCSessionDescription() threw exception TypeError: DOM object constructor cannot be called as a function..
     17PASS RTCIceCandidate() threw exception TypeError: DOM object constructor cannot be called as a function..
    918PASS new webkitPeerConnection00('STUN foobar.com:12345', function(){}); did not throw exception.
    10 PASS new webkitPeerConnection00('STUN foobar.com:12345'); threw exception TypeError: Not enough arguments.
    11 PASS new webkitPeerConnection00('STUN foobar.com:12345', null); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    12 PASS new webkitPeerConnection00('STUN foobar.com:12345', undefined); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    13 PASS new webkitPeerConnection00('STUN foobar.com:12345', 'STUN'); threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    1419PASS new SessionDescription(''); did not throw exception.
    1520PASS new IceCandidate('', ''); did not throw exception.
     21PASS new webkitRTCPeerConnection({iceServers:[{uri:'stun://foobar.com:12345'}]}, null); did not throw exception.
     22PASS new RTCSessionDescription({type:'offer',sdp:'foobar'}); did not throw exception.
     23PASS new RTCIceCandidate({candidate:'foo'}); did not throw exception.
    1624PASS successfullyParsed is true
    1725
  • trunk/LayoutTests/fast/mediastream/constructors.html

    r118586 r126779  
    1414shouldBeTrue("typeof SessionDescription === 'function'");
    1515shouldBeTrue("typeof IceCandidate === 'function'");
     16shouldBeTrue("typeof webkitRTCPeerConnection === 'function'");
     17shouldBeTrue("typeof RTCSessionDescription === 'function'");
     18shouldBeTrue("typeof RTCIceCandidate === 'function'");
     19
     20shouldThrow("webkitPeerConnection00()");
     21shouldThrow("SessionDescription()");
     22shouldThrow("IceCandidate()");
     23shouldThrow("webkitRTCPeerConnection()");
     24shouldThrow("RTCSessionDescription()");
     25shouldThrow("RTCIceCandidate()");
    1626
    1727shouldNotThrow("new webkitPeerConnection00('STUN foobar.com:12345', function(){});");
    18 shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345');");
    19 shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345', null);");
    20 shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345', undefined);");
    21 shouldThrow("new webkitPeerConnection00('STUN foobar.com:12345', 'STUN');");
    22 
    2328shouldNotThrow("new SessionDescription('');");
    2429shouldNotThrow("new IceCandidate('', '');");
     30shouldNotThrow("new webkitRTCPeerConnection({iceServers:[{uri:'stun://foobar.com:12345'}]}, null);");
     31shouldNotThrow("new RTCSessionDescription({type:'offer',sdp:'foobar'});");
     32shouldNotThrow("new RTCIceCandidate({candidate:'foo'});");
    2533
    2634window.jsTestIsAsync = false;
  • trunk/Source/WebCore/ChangeLog

    r126777 r126779  
     12012-08-27  Tommy Widenflycht  <tommyw@google.com>
     2
     3        MediaStream API: Fix review comments from patch #93119
     4        https://bugs.webkit.org/show_bug.cgi?id=95064
     5
     6        Reviewed by Adam Barth.
     7
     8        Adding const to accessors.
     9
     10        Change covered by exisiting tests..
     11
     12        * Modules/mediastream/RTCIceCandidate.cpp:
     13        (WebCore::RTCIceCandidate::candidate):
     14        (WebCore::RTCIceCandidate::sdpMid):
     15        (WebCore::RTCIceCandidate::sdpMLineIndex):
     16        * Modules/mediastream/RTCIceCandidate.h:
     17        (RTCIceCandidate):
     18        * Modules/mediastream/RTCSessionDescription.cpp:
     19        (WebCore::RTCSessionDescription::create):
     20        (WebCore::RTCSessionDescription::type):
     21        (WebCore::RTCSessionDescription::sdp):
     22        * Modules/mediastream/RTCSessionDescription.h:
     23        (RTCSessionDescription):
     24
    1252012-08-27  Simon Fraser  <simon.fraser@apple.com>
    226
  • trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp

    r126328 r126779  
    7474}
    7575
    76 const String& RTCIceCandidate::candidate()
     76const String& RTCIceCandidate::candidate() const
    7777{
    7878    return m_descriptor->candidate();
    7979}
    8080
    81 const String& RTCIceCandidate::sdpMid()
     81const String& RTCIceCandidate::sdpMid() const
    8282{
    8383    return m_descriptor->sdpMid();
    8484}
    8585
    86 unsigned short RTCIceCandidate::sdpMLineIndex()
     86unsigned short RTCIceCandidate::sdpMLineIndex() const
    8787{
    8888    return m_descriptor->sdpMLineIndex();
  • trunk/Source/WebCore/Modules/mediastream/RTCIceCandidate.h

    r126328 r126779  
    5151    virtual ~RTCIceCandidate();
    5252
    53     const String& candidate();
    54     const String& sdpMid();
    55     unsigned short sdpMLineIndex();
     53    const String& candidate() const;
     54    const String& sdpMid() const;
     55    unsigned short sdpMLineIndex() const;
    5656
    5757    RTCIceCandidateDescriptor* descriptor();
  • trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.cpp

    r126333 r126779  
    5757    String sdp;
    5858    ok = dictionary.get("sdp", sdp);
    59     if (!ok || !sdp.length()) {
     59    if (!ok || sdp.isEmpty()) {
    6060        ec = TYPE_MISMATCH_ERR;
    6161        return 0;
     
    8080}
    8181
    82 const String& RTCSessionDescription::type()
     82const String& RTCSessionDescription::type() const
    8383{
    8484    return m_descriptor->type();
     
    9393}
    9494
    95 const String& RTCSessionDescription::sdp()
     95const String& RTCSessionDescription::sdp() const
    9696{
    9797    return m_descriptor->sdp();
  • trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.h

    r126333 r126779  
    5050    virtual ~RTCSessionDescription();
    5151
    52     const String& type();
     52    const String& type() const;
    5353    void setType(const String&, ExceptionCode&);
    5454
    55     const String& sdp();
     55    const String& sdp() const;
    5656    void setSdp(const String&, ExceptionCode&);
    5757
Note: See TracChangeset for help on using the changeset viewer.