Changeset 218335 in webkit


Ignore:
Timestamp:
Jun 15, 2017 9:24:20 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
https://bugs.webkit.org/show_bug.cgi?id=173118
<rdar://problem/32746761>

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

LayoutTests/imported/w3c:

  • web-platform-tests/webrtc/RTCPeerConnection-createOffer-expected.txt:

Source/WebCore:

Test: webrtc/createOfferAnswer.html

Making the promise return a RTCSessionDescription::Init instead of a RTCSessionDescription.
This aligns with the spec and is more optimal.

  • Modules/mediastream/PeerConnectionBackend.cpp:

(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):

  • Modules/mediastream/PeerConnectionBackend.h:
  • Modules/mediastream/RTCSessionDescription.idl:

LayoutTests:

  • fast/mediastream/RTCPeerConnection-setLocalDescription-offer-expected.txt:
  • fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
  • webrtc/createOfferAnswer-expected.txt: Added.
  • webrtc/createOfferAnswer.html: Added.
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r218334 r218335  
     12017-06-15  Youenn Fablet  <youenn@apple.com>
     2
     3        RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
     4        https://bugs.webkit.org/show_bug.cgi?id=173118
     5        <rdar://problem/32746761>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * fast/mediastream/RTCPeerConnection-setLocalDescription-offer-expected.txt:
     10        * fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
     11        * webrtc/createOfferAnswer-expected.txt: Added.
     12        * webrtc/createOfferAnswer.html: Added.
     13
    1142017-06-15  Matt Lewis  <jlewis3@apple.com>
    215
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-setLocalDescription-offer-expected.txt

    r214075 r218335  
    2020PASS firstOffer set as local description
    2121FAIL pc.signalingState should be have-local-offer. Was stable.
    22 FAIL pc.localDescription should be [object RTCSessionDescription]. Was null.
    23 FAIL pc.pendingLocalDescription should be [object RTCSessionDescription]. Was null.
     22FAIL pc.localDescription should be [object Object]. Was null.
     23FAIL pc.pendingLocalDescription should be [object Object]. Was null.
    2424PASS pc.currentLocalDescription is null
    2525FAIL Error caught in promise chain: TypeError: null is not an object (evaluating 'pc.localDescription.type')
  • trunk/LayoutTests/fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt

    r214075 r218335  
    1313PASS remoteOffer1 set as remote description
    1414FAIL pc.signalingState should be have-remote-offer. Was stable.
    15 FAIL pc.remoteDescription should be [object RTCSessionDescription]. Was null.
    16 FAIL pc.pendingRemoteDescription should be [object RTCSessionDescription]. Was null.
     15FAIL pc.remoteDescription should be [object Object]. Was null.
     16FAIL pc.pendingRemoteDescription should be [object Object]. Was null.
    1717PASS pc.currentRemoteDescription is null
    1818
     
    3030PASS remoteOffer2 set as remote description
    3131FAIL pc.signalingState should be have-remote-offer. Was stable.
    32 FAIL pc.remoteDescription should be [object RTCSessionDescription]. Was null.
    33 FAIL pc.pendingRemoteDescription should be [object RTCSessionDescription]. Was null.
     32FAIL pc.remoteDescription should be [object Object]. Was null.
     33FAIL pc.pendingRemoteDescription should be [object Object]. Was null.
    3434PASS pc.currentRemoteDescription is null
    3535
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r218247 r218335  
     12017-06-15  Youenn Fablet  <youenn@apple.com>
     2
     3        RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
     4        https://bugs.webkit.org/show_bug.cgi?id=173118
     5        <rdar://problem/32746761>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * web-platform-tests/webrtc/RTCPeerConnection-createOffer-expected.txt:
     10
    1112017-06-14  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createOffer-expected.txt

    r218181 r218335  
    11
    2 FAIL createOffer() with no argument from newly created RTCPeerConnection should succeed assert_false: Expect offer to not be instance of RTCSessionDescription expected false got true
     2PASS createOffer() with no argument from newly created RTCPeerConnection should succeed
    33FAIL createOffer() and then setLocalDescription() should succeed assert_not_equals: Expect session description to be defined, but got undefined got disallowed value undefined
    44PASS createOffer() after connection is closed should reject with InvalidStateError
  • trunk/Source/WebCore/ChangeLog

    r218318 r218335  
     12017-06-15  Youenn Fablet  <youenn@apple.com>
     2
     3        RTCPeerConnection returns RTCSessionDescription where RTCSessionDescriptionInit would be appropriate
     4        https://bugs.webkit.org/show_bug.cgi?id=173118
     5        <rdar://problem/32746761>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Test: webrtc/createOfferAnswer.html
     10
     11        Making the promise return a RTCSessionDescription::Init instead of a RTCSessionDescription.
     12        This aligns with the spec and is more optimal.
     13
     14        * Modules/mediastream/PeerConnectionBackend.cpp:
     15        (WebCore::PeerConnectionBackend::createOfferSucceeded):
     16        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
     17        * Modules/mediastream/PeerConnectionBackend.h:
     18        * Modules/mediastream/RTCSessionDescription.idl:
     19
    1202017-06-15 Emilio Cobos Álvarez  <ecobos@igalia.com>
    221
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp

    r218168 r218335  
    6363
    6464    ASSERT(m_offerAnswerPromise);
    65     m_offerAnswerPromise->resolve(RTCSessionDescription::create(RTCSdpType::Offer, filterSDP(WTFMove(sdp))));
     65    m_offerAnswerPromise->resolve(RTCSessionDescription::Init { RTCSdpType::Offer, filterSDP(WTFMove(sdp)) });
    6666    m_offerAnswerPromise = std::nullopt;
    6767}
     
    9898
    9999    ASSERT(m_offerAnswerPromise);
    100     m_offerAnswerPromise->resolve(RTCSessionDescription::create(RTCSdpType::Answer, WTFMove(sdp)));
     100    m_offerAnswerPromise->resolve(RTCSessionDescription::Init { RTCSdpType::Answer, WTFMove(sdp) });
    101101    m_offerAnswerPromise = std::nullopt;
    102102}
  • trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h

    r218168 r218335  
    3636#include "JSDOMPromiseDeferred.h"
    3737#include "RTCRtpParameters.h"
     38#include "RTCSessionDescription.h"
    3839#include "RTCSignalingState.h"
    3940
     
    5758
    5859namespace PeerConnection {
    59 using SessionDescriptionPromise = DOMPromiseDeferred<IDLInterface<RTCSessionDescription>>;
     60using SessionDescriptionPromise = DOMPromiseDeferred<IDLDictionary<RTCSessionDescription::Init>>;
    6061using StatsPromise = DOMPromiseDeferred<IDLInterface<RTCStatsReport>>;
    6162}
  • trunk/Source/WebCore/Modules/mediastream/RTCSessionDescription.idl

    r214212 r218335  
    4949    PublicIdentifier,
    5050] interface RTCSessionDescription {
    51     [SetterMayThrowException] readonly attribute RTCSdpType type;
     51    readonly attribute RTCSdpType type;
    5252    readonly attribute DOMString sdp;
    5353
     
    5555};
    5656
    57 dictionary RTCSessionDescriptionInit {
     57[
     58    Conditional=WEB_RTC,
     59    JSGenerateToJSObject
     60] dictionary RTCSessionDescriptionInit {
    5861    required RTCSdpType type;
    5962    DOMString sdp = "";
Note: See TracChangeset for help on using the changeset viewer.