Changeset 214441 in webkit
- Timestamp:
- Mar 27, 2017, 4:36:36 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r214437 r214441 1 2017-03-27 Youenn Fablet <youenn@apple.com> 2 3 addIceCandidate should not throw if passed null or undefined 4 https://bugs.webkit.org/show_bug.cgi?id=170118 5 6 Reviewed by Eric Carlson. 7 8 Updating test to log addIceCandidate rejection. 9 10 * webrtc/datachannel/basic.html: 11 * webrtc/routines.js: 12 (iceCallback1): 13 (iceCallback2): 14 (onAddIceCandidateError): 15 1 16 2017-03-27 Ryan Haddad <ryanhaddad@apple.com> 2 17 -
trunk/LayoutTests/imported/w3c/ChangeLog
r214293 r214441 1 2017-03-27 Youenn Fablet <youenn@apple.com> 2 3 addIceCandidate should not throw if passed null or undefined 4 https://bugs.webkit.org/show_bug.cgi?id=170118 5 6 Reviewed by Eric Carlson. 7 8 * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt: 9 1 10 2017-03-22 Youenn Fablet <youenn@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt
r211886 r214441 24 24 PASS RTCPeerConnection interface: attribute currentRemoteDescription 25 25 PASS RTCPeerConnection interface: attribute pendingRemoteDescription 26 FAIL RTCPeerConnection interface: operation addIceCandidate( RTCIceCandidate) assert_equals: property has wrong .length expected 1 but got 026 FAIL RTCPeerConnection interface: operation addIceCandidate([object Object],[object Object]) assert_equals: property has wrong .length expected 1 but got 0 27 27 PASS RTCPeerConnection interface: attribute signalingState 28 28 PASS RTCPeerConnection interface: attribute iceGatheringState … … 80 80 PASS RTCPeerConnection interface: pc must inherit property "pendingRemoteDescription" with the proper type (9) 81 81 PASS RTCPeerConnection interface: pc must inherit property "addIceCandidate" with the proper type (10) 82 PASS RTCPeerConnection interface: calling addIceCandidate(RTCIceCandidate) on pc with too few arguments must throw TypeError 82 FAIL RTCPeerConnection interface: calling addIceCandidate([object Object],[object Object]) on pc with too few arguments must throw TypeError assert_unreached: Should have rejected: undefined Reached unreachable code 83 83 FAIL RTCPeerConnection interface: pc must inherit property "signalingState" with the proper type (11) Unrecognized type RTCSignalingState 84 84 FAIL RTCPeerConnection interface: pc must inherit property "iceGatheringState" with the proper type (12) Unrecognized type RTCIceGatheringState -
trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
r207939 r214441 34 34 readonly attribute RTCSessionDescription? currentRemoteDescription; 35 35 readonly attribute RTCSessionDescription? pendingRemoteDescription; 36 Promise<void> addIceCandidate ( RTCIceCandidatecandidate);36 Promise<void> addIceCandidate ((RTCIceCandidateInit or RTCIceCandidate) candidate); 37 37 readonly attribute RTCSignalingState signalingState; 38 38 readonly attribute RTCIceGatheringState iceGatheringState; -
trunk/LayoutTests/webrtc/datachannel/basic.html
r214421 r214441 96 96 remoteChannel.onmessage = receiveMessages; 97 97 }; 98 }, (candidate) => { return candidate .candidate.toLowerCase().indexOf("udp") == -1; });98 }, (candidate) => { return candidate && candidate.candidate.toLowerCase().indexOf("udp") == -1; }); 99 99 }); 100 100 }, "Basic data channel exchange from offerer to receiver using UDP only"); … … 115 115 remoteChannel.onmessage = receiveMessages; 116 116 }; 117 }, (candidate) => { return candidate .candidate.toLowerCase().indexOf("tcp") == -1; });117 }, (candidate) => { return candidate && candidate.candidate.toLowerCase().indexOf("tcp") == -1; }); 118 118 }); 119 119 }, "Basic data channel exchange from offerer to receiver using TCP only"); -
trunk/LayoutTests/webrtc/routines.js
r213983 r214441 43 43 function iceCallback1(event, filterOutICECandidate) 44 44 { 45 if (!event.candidate)46 return;47 48 45 if (filterOutICECandidate && filterOutICECandidate(event.candidate)) 49 46 return; … … 54 51 function iceCallback2(event, filterOutICECandidate) 55 52 { 56 if (!event.candidate)57 return;58 59 53 if (filterOutICECandidate && filterOutICECandidate(event.candidate)) 60 54 return; 61 55 62 if (event.candidate) 63 localConnection.addIceCandidate(event.candidate).then(onAddIceCandidateSuccess, onAddIceCandidateError); 56 localConnection.addIceCandidate(event.candidate).then(onAddIceCandidateSuccess, onAddIceCandidateError); 64 57 } 65 58 … … 70 63 function onAddIceCandidateError(error) 71 64 { 65 console.log("addIceCandidate error: " + error) 72 66 assert_unreached(); 73 67 } -
trunk/Source/WebCore/ChangeLog
r214435 r214441 1 2017-03-27 Youenn Fablet <youenn@apple.com> 2 3 addIceCandidate should not throw if passed null or undefined 4 https://bugs.webkit.org/show_bug.cgi?id=170118 5 6 Reviewed by Eric Carlson. 7 8 Covered by updated test. 9 10 A null/undefined candidate passed to addIceCandidate means end of Ice candidate.. 11 12 * Modules/mediastream/PeerConnectionBackend.cpp: 13 (WebCore::PeerConnectionBackend::addIceCandidate): 14 * Modules/mediastream/PeerConnectionBackend.h: 15 (WebCore::PeerConnectionBackend::endOfIceCandidates): 16 * Modules/mediastream/RTCPeerConnection.cpp: 17 (WebCore::RTCPeerConnection::queuedAddIceCandidate): 18 * Modules/mediastream/RTCPeerConnection.h: 19 * Modules/mediastream/RTCPeerConnection.idl: 20 * Modules/mediastream/RTCPeerConnection.js: 21 (addIceCandidate): 22 1 23 2017-03-27 Antti Koivisto <antti@apple.com> 2 24 -
trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
r214330 r214441 226 226 } 227 227 228 void PeerConnectionBackend::addIceCandidate(RTCIceCandidate& iceCandidate, DOMPromise<void>&& promise) 229 { 230 ASSERT(m_peerConnection.signalingState() != RTCSignalingState::Closed); 231 232 if (iceCandidate.sdpMid().isNull() && !iceCandidate.sdpMLineIndex()) { 228 void PeerConnectionBackend::addIceCandidate(RTCIceCandidate* iceCandidate, DOMPromise<void>&& promise) 229 { 230 ASSERT(m_peerConnection.signalingState() != RTCSignalingState::Closed); 231 232 if (!iceCandidate) { 233 endOfIceCandidates(WTFMove(promise)); 234 return; 235 } 236 237 // FIXME: As per https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addicecandidate(), this check should be done before enqueuing the task. 238 if (iceCandidate->sdpMid().isNull() && !iceCandidate->sdpMLineIndex()) { 233 239 promise.reject(Exception { TypeError, ASCIILiteral("Trying to add a candidate that is missing both sdpMid and sdpMLineIndex") }); 234 240 return; 235 241 } 236 242 m_addIceCandidatePromise = WTFMove(promise); 237 doAddIceCandidate( iceCandidate);243 doAddIceCandidate(*iceCandidate); 238 244 } 239 245 -
trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
r214420 r214441 63 63 using CreatePeerConnectionBackend = std::unique_ptr<PeerConnectionBackend> (*)(RTCPeerConnection&); 64 64 65 // FIXME: What is the value of this abstract class? There is only one concrete class derived from it.66 65 class PeerConnectionBackend { 67 66 public: … … 75 74 void setLocalDescription(RTCSessionDescription&, DOMPromise<void>&&); 76 75 void setRemoteDescription(RTCSessionDescription&, DOMPromise<void>&&); 77 void addIceCandidate(RTCIceCandidate &, DOMPromise<void>&&);76 void addIceCandidate(RTCIceCandidate*, DOMPromise<void>&&); 78 77 79 78 virtual std::unique_ptr<RTCDataChannelHandler> createDataChannelHandler(const String&, const RTCDataChannelInit&) = 0; … … 138 137 virtual void doSetRemoteDescription(RTCSessionDescription&) = 0; 139 138 virtual void doAddIceCandidate(RTCIceCandidate&) = 0; 139 virtual void endOfIceCandidates(DOMPromise<void>&& promise) { promise.resolve(); } 140 140 virtual void doStop() = 0; 141 141 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r214421 r214441 279 279 } 280 280 281 void RTCPeerConnection::queuedAddIceCandidate(RTCIceCandidate &rtcCandidate, DOMPromise<void>&& promise)281 void RTCPeerConnection::queuedAddIceCandidate(RTCIceCandidate* rtcCandidate, DOMPromise<void>&& promise) 282 282 { 283 283 if (m_signalingState == RTCSignalingState::Closed) { -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h
r214420 r214441 87 87 RefPtr<RTCSessionDescription> pendingRemoteDescription() const; 88 88 89 void queuedAddIceCandidate(RTCIceCandidate &, DOMPromise<void>&&);89 void queuedAddIceCandidate(RTCIceCandidate*, DOMPromise<void>&&); 90 90 91 91 RTCSignalingState signalingState() const { return m_signalingState; } -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
r214421 r214441 111 111 [PrivateIdentifier] Promise<void> queuedSetLocalDescription(RTCSessionDescription description); 112 112 [PrivateIdentifier] Promise<void> queuedSetRemoteDescription(RTCSessionDescription description); 113 [PrivateIdentifier] Promise<void> queuedAddIceCandidate(RTCIceCandidate candidate);113 [PrivateIdentifier] Promise<void> queuedAddIceCandidate(RTCIceCandidate? candidate); 114 114 115 115 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js
r214293 r214441 251 251 "argName": "candidate", 252 252 "argType": "RTCIceCandidate", 253 "maybeDictionary": "true" 253 "maybeDictionary": "true", 254 "defaultsToNull" : "true" 254 255 }; 255 256 return @objectAndCallbacksOverload(arguments, "addIceCandidate", objectInfo, function (candidate) {
Note:
See TracChangeset
for help on using the changeset viewer.