RTCPeerConnection methods can take dictionaries as input
https://bugs.webkit.org/show_bug.cgi?id=167590

Patch by Youenn Fablet <youenn@apple.com> on 2017-01-31
Reviewed by Alex Christensen.

Source/WebCore:

Test: webrtc/rtcpeerconnection-error-messages.html

Made addIceCandidate/setRemoteDescription/setLocalDescription take either dictionaries or objects as parameter.
Spec only mandates this for addIceCandidate, but sites may be using the old version for setRemoteDescription and setLocalDescription.

Updated RTCPeerConnection methods error messages.

* Modules/mediastream/RTCPeerConnection.js:
(getLocalStreams):
(getStreamById):
(addStream):
(createOffer):
(createAnswer):
(setLocalDescription):
(setRemoteDescription):
(addIceCandidate):
(getStats):
* Modules/mediastream/RTCPeerConnectionInternals.js:

LayoutTests:

Replacing fast/mediastream/RTCPeerConnection-js-built-ins-check-this.html by webrtc/rtcpeerconnection-error-messages.html.
It is a bit more thorough and does not hard code the error message.

* fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:
* fast/mediastream/RTCPeerConnection-addIceCandidate.html:
* fast/mediastream/RTCPeerConnection-js-built-ins-check-this-expected.txt: Removed.
* fast/mediastream/RTCPeerConnection-js-built-ins-check-this.html: Removed.
* fast/mediastream/RTCPeerConnection-setLocalDescription-offer-expected.txt:
* fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html:
* fast/mediastream/RTCPeerConnection-setRemoteDescription-offer-expected.txt:
* fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html:
* webrtc/rtcpeerconnection-error-messages-expected.txt: Added.
* webrtc/rtcpeerconnection-error-messages.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@211436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate.html b/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate.html
index a45dd92..9f383ff 100644
--- a/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate.html
+++ b/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate.html
@@ -74,9 +74,11 @@
             })
             .then(function () {
                 debug("<br>*** Test some OK input");
-                return promiseShouldResolve("pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid}))");
+                // Testing passing a RTCIceCandidateInit
+                return promiseShouldResolve("pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid})");
             })
             .then(function () {
+                // Testing passing a RTCIceCandidate
                 return promiseShouldResolve("pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: sdpMLineIndex}))");
             })
             .then(function () {