Title: [210017] trunk
Revision
210017
Author
[email protected]
Date
2016-12-20 02:24:39 -0800 (Tue, 20 Dec 2016)

Log Message

WebRTC: RTCPeerConnection constructor argument should be optional
https://bugs.webkit.org/show_bug.cgi?id=164057

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Update expectation of RTCPeerConnection constructor tests.

* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:

Source/WebCore:

Modify RTCPeerConnection JSBuiltin constructor to allow RTCPeerConfiguration
argument to be optional.

Update existing tests.

* Modules/mediastream/RTCPeerConnection.js:
(initializeRTCPeerConnection):

LayoutTests:

Remove tests since they are duplicated with WPT tests.

* fast/mediastream/RTCPeerConnection-expected.txt:
* fast/mediastream/RTCPeerConnection.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (210016 => 210017)


--- trunk/LayoutTests/ChangeLog	2016-12-20 08:32:52 UTC (rev 210016)
+++ trunk/LayoutTests/ChangeLog	2016-12-20 10:24:39 UTC (rev 210017)
@@ -1,3 +1,15 @@
+2016-12-20  Nael Ouedraogo  <[email protected]>
+
+        WebRTC: RTCPeerConnection constructor argument should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=164057
+
+        Reviewed by Youenn Fablet.
+
+        Remove tests since they are duplicated with WPT tests.
+
+        * fast/mediastream/RTCPeerConnection-expected.txt:
+        * fast/mediastream/RTCPeerConnection.html:
+
 2016-12-19  Ryan Haddad  <[email protected]>
 
         Marking http/tests/fetch/fetching-same-resource-with-diffferent-options.html as flaky on macOS.

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt (210016 => 210017)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt	2016-12-20 08:32:52 UTC (rev 210016)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt	2016-12-20 10:24:39 UTC (rev 210017)
@@ -4,8 +4,6 @@
 
 
 PASS new RTCPeerConnection(null); threw exception TypeError: RTCPeerConnection argument must be a valid dictionary.
-PASS new RTCPeerConnection(undefined); threw exception TypeError: RTCPeerConnection argument must be a valid dictionary.
-PASS new RTCPeerConnection(); threw exception TypeError: Not enough arguments.
 PASS new RTCPeerConnection(''); threw exception TypeError: RTCPeerConnection argument must be a valid dictionary.
 PASS new RTCPeerConnection({}); did not throw exception.
 PASS new RTCPeerConnection({iceServers:[]}); did not throw exception.

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection.html (210016 => 210017)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection.html	2016-12-20 08:32:52 UTC (rev 210016)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection.html	2016-12-20 10:24:39 UTC (rev 210017)
@@ -8,8 +8,6 @@
             description("Tests the RTCPeerConnection constructor.");
 
             shouldThrow("new RTCPeerConnection(null);");
-            shouldThrow("new RTCPeerConnection(undefined);");
-            shouldThrow("new RTCPeerConnection();");
             shouldThrow("new RTCPeerConnection('');");
             shouldNotThrow("new RTCPeerConnection({});");
             shouldNotThrow("new RTCPeerConnection({iceServers:[]});");

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (210016 => 210017)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-12-20 08:32:52 UTC (rev 210016)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-12-20 10:24:39 UTC (rev 210017)
@@ -1,3 +1,14 @@
+2016-12-20  Nael Ouedraogo  <[email protected]>
+
+        WebRTC: RTCPeerConnection constructor argument should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=164057
+
+        Reviewed by Youenn Fablet.
+
+        Update expectation of RTCPeerConnection constructor tests.
+
+        * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt:
+
 2016-12-16  Youenn Fablet  <[email protected]>
 
         [Fetch API] Improve resource loading console logging

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt (210016 => 210017)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt	2016-12-20 08:32:52 UTC (rev 210016)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-constructor-expected.txt	2016-12-20 10:24:39 UTC (rev 210017)
@@ -1,8 +1,8 @@
 
 PASS RTCPeerConnection.length 
-FAIL new RTCPeerConnection() Not enough arguments
+PASS new RTCPeerConnection() 
 FAIL new RTCPeerConnection(null) RTCPeerConnection argument must be a valid dictionary
-FAIL new RTCPeerConnection(undefined) RTCPeerConnection argument must be a valid dictionary
+PASS new RTCPeerConnection(undefined) 
 PASS new RTCPeerConnection({}) 
 PASS new RTCPeerConnection({ iceServers: null }) 
 PASS new RTCPeerConnection({ iceServers: undefined }) 
@@ -93,15 +93,15 @@
       }" did not throw
 FAIL new RTCPeerConnection({ certificates: [certificate] }) RTCPeerConnection.generateCertificate is not a function. (In 'RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256" })', 'RTCPeerConnection.generateCertificate' is undefined)
 FAIL new RTCPeerConnection({ certificates: [expiredCertificate] }) RTCPeerConnection.generateCertificate is not a function. (In 'RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires: 0 })', 'RTCPeerConnection.generateCertificate' is undefined)
-FAIL localDescription initial value Not enough arguments
-FAIL currentLocalDescription initial value Not enough arguments
-FAIL pendingLocalDescription initial value Not enough arguments
-FAIL remoteDescription initial value Not enough arguments
-FAIL currentRemoteDescription initial value Not enough arguments
-FAIL pendingRemoteDescription initial value Not enough arguments
-FAIL signalingState initial value Not enough arguments
-FAIL iceGatheringState initial value Not enough arguments
-FAIL iceConnectionState initial value Not enough arguments
-FAIL connectionState initial value Not enough arguments
-FAIL canTrickleIceCandidates initial value Not enough arguments
+PASS localDescription initial value 
+PASS currentLocalDescription initial value 
+PASS pendingLocalDescription initial value 
+PASS remoteDescription initial value 
+PASS currentRemoteDescription initial value 
+PASS pendingRemoteDescription initial value 
+PASS signalingState initial value 
+PASS iceGatheringState initial value 
+PASS iceConnectionState initial value 
+FAIL connectionState initial value assert_equals: expected (string) "new" but got (undefined) undefined
+FAIL canTrickleIceCandidates initial value assert_equals: expected (object) null but got (undefined) undefined
 

Modified: trunk/Source/WebCore/ChangeLog (210016 => 210017)


--- trunk/Source/WebCore/ChangeLog	2016-12-20 08:32:52 UTC (rev 210016)
+++ trunk/Source/WebCore/ChangeLog	2016-12-20 10:24:39 UTC (rev 210017)
@@ -1,3 +1,18 @@
+2016-12-20  Nael Ouedraogo  <[email protected]>
+
+        WebRTC: RTCPeerConnection constructor argument should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=164057
+
+        Reviewed by Youenn Fablet.
+
+        Modify RTCPeerConnection JSBuiltin constructor to allow RTCPeerConfiguration
+        argument to be optional.
+
+        Update existing tests.
+
+        * Modules/mediastream/RTCPeerConnection.js:
+        (initializeRTCPeerConnection):
+
 2016-12-19  Yusuke Suzuki  <[email protected]>
 
         [ES6] Enable ES6 Modules

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js (210016 => 210017)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js	2016-12-20 08:32:52 UTC (rev 210016)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js	2016-12-20 10:24:39 UTC (rev 210017)
@@ -34,10 +34,9 @@
 {
     "use strict";
 
-    if (arguments.length < 1)
-        @throwTypeError("Not enough arguments");
-
-    if (!@isObject(configuration))
+    if (configuration === @undefined)
+        configuration = {};
+    else if (!@isObject(configuration))
         @throwTypeError("RTCPeerConnection argument must be a valid dictionary");
 
     // FIXME: Handle errors in a better way than catching and re-throwing (http://webkit.org/b/158936)
@@ -48,7 +47,6 @@
             : "Error creating RTCPeerConnection";
         @throwTypeError(message);
     }
-
     this.@operations = [];
     this.@localStreams = [];
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to