Title: [216537] trunk
Revision
216537
Author
[email protected]
Date
2017-05-09 13:58:04 -0700 (Tue, 09 May 2017)

Log Message

Refresh webrtc WPT tests
https://bugs.webkit.org/show_bug.cgi?id=171878

Patch by Youenn Fablet <[email protected]> on 2017-05-09
Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/webrtc/OWNERS:
* web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize-expected.txt: Added.
* web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html: Added.
* web-platform-tests/webrtc/RTCDataChannel-id-expected.txt: Added.
* web-platform-tests/webrtc/RTCDataChannel-id.html: Added.
* web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt: Added.
* web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html: Added.
* web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt: Added.
* web-platform-tests/webrtc/RTCPeerConnection-constructor.html: Added.
* web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt: Added.
* web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html: Added.
* web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState-expected.txt: Added.
* web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html: Added.
* web-platform-tests/webrtc/RTCPeerConnection-idl-expected.txt: Added.
* web-platform-tests/webrtc/RTCPeerConnection-idl.html: Added.
* web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt: Added.
* web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html: Added.
* web-platform-tests/webrtc/datachannel-idlharness-expected.txt: Added.
* web-platform-tests/webrtc/datachannel-idlharness.html: Added.
* web-platform-tests/webrtc/getstats-expected.txt: Added.
* web-platform-tests/webrtc/getstats.html: Added.
* web-platform-tests/webrtc/interfaces-expected.txt: Added.
* web-platform-tests/webrtc/interfaces.html: Added.
* web-platform-tests/webrtc/no-media-call.html:
* web-platform-tests/webrtc/promises-call.html:
* web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:
* web-platform-tests/webrtc/simplecall.html:
* web-platform-tests/webrtc/w3c-import.log:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html
       imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html
       imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
       imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html
       imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html
       imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html
       imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html
       imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html
       imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html
       imported/w3c/web-platform-tests/webrtc/getstats.html
       imported/w3c/web-platform-tests/webrtc/interfaces.html

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createDataChannel): exiting early if libwebrtc is not creating a data channel.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (216536 => 216537)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-05-09 20:58:04 UTC (rev 216537)
@@ -1,3 +1,40 @@
+2017-05-09  Youenn Fablet  <[email protected]>
+
+        Refresh webrtc WPT tests
+        https://bugs.webkit.org/show_bug.cgi?id=171878
+
+        Reviewed by Eric Carlson.
+
+        * resources/import-expectations.json:
+        * web-platform-tests/webrtc/OWNERS:
+        * web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html: Added.
+        * web-platform-tests/webrtc/RTCDataChannel-id-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCDataChannel-id.html: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-constructor.html: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-idl-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-idl.html: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt: Added.
+        * web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html: Added.
+        * web-platform-tests/webrtc/datachannel-idlharness-expected.txt: Added.
+        * web-platform-tests/webrtc/datachannel-idlharness.html: Added.
+        * web-platform-tests/webrtc/getstats-expected.txt: Added.
+        * web-platform-tests/webrtc/getstats.html: Added.
+        * web-platform-tests/webrtc/interfaces-expected.txt: Added.
+        * web-platform-tests/webrtc/interfaces.html: Added.
+        * web-platform-tests/webrtc/no-media-call.html:
+        * web-platform-tests/webrtc/promises-call.html:
+        * web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt:
+        * web-platform-tests/webrtc/simplecall.html:
+        * web-platform-tests/webrtc/w3c-import.log:
+
 2017-05-09  Romain Bellessort  <[email protected]>
 
         [Readable Streams API] Enable creation of ReadableStreamBYOBReader

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/OWNERS (216536 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/OWNERS	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/OWNERS	2017-05-09 20:58:04 UTC (rev 216537)
@@ -1,4 +1,7 @@
+@agouaillard
+@alvestrand
 @dontcallmedom
-@alvestrand
+@foolip
+@guidou
+@henbos
 @phoglund
-@agouaillard

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,9 @@
+
+PASS Setting iceCandidatePoolSize to a valid value: 10 
+PASS Setting iceCandidatePoolSize to a valid value: 0 
+PASS Setting iceCandidatePoolSize to a valid value: null 
+PASS Setting iceCandidatePoolSize to a valid value: undefined 
+PASS Setting iceCandidatePoolSize to an invalid value: -1 
+PASS Setting iceCandidatePoolSize to an invalid value: 1000 
+PASS Setting iceCandidatePoolSize to an invalid value: string 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,35 @@
+<!doctype html>
+<html>
+<head>
+<title>This test checks that RTCConfiguration.iceCandidatePoolSize is set</title>
+<script src=""
+<script src=""
+</head>
+<body>
+<script>
+function testValidPoolSize(size, expectedSize)
+{
+    test(function() {
+        var pc = new RTCPeerConnection({iceCandidatePoolSize: size})
+        assert_equals(pc.getConfiguration().iceCandidatePoolSize, expectedSize !== undefined ? expectedSize : size)
+    }, "Setting iceCandidatePoolSize to a valid value: " + size)
+}
+
+function testInvalidPoolSize(size)
+{
+    test(function() {
+        assert_throws(new TypeError(), () => new RTCPeerConnection({iceCandidatePoolSize: size}))
+    }, "Setting iceCandidatePoolSize to an invalid value: " + size)
+}
+
+testValidPoolSize(10)
+testValidPoolSize(0)
+testValidPoolSize(null, 0)
+testValidPoolSize(undefined, 0)
+
+testInvalidPoolSize(-1)
+testInvalidPoolSize(1000)
+testInvalidPoolSize("string")
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,4 @@
+
+FAIL DTLS client uses odd data channel IDs assert_equals: id expected 1 but got 0
+FAIL DTLS server uses even data channel IDs assert_not_equals: got disallowed value null
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,60 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCDataChannel id attribute</title>
+<script src=""
+<script src=""
+<script>
+'use strict';
+
+// This and the test below verify that after a description is set that
+// negotiates the DTLS role used by SCTP, data channels with unset IDs
+// have IDs set according to the rules in rtcweb-data-channel.
+promise_test(test => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('');
+  return pc.createOffer()
+  .then(offer => pc.setLocalDescription(offer))
+  .then(() => {
+    // Turn our own offer SDP into valid answer SDP by setting the DTLS role to
+    // "active".
+    const answer = {
+      type: "answer",
+      sdp: pc.localDescription.sdp.replace("actpass", "active")
+    };
+    return pc.setRemoteDescription(answer);
+  })
+  .then(() => {
+    // Since the remote description had an "active" DTLS role, we're the server
+    // and should use odd data channel IDs, according to rtcweb-data-channel.
+    assert_equals(channel.id % 2, 1, 'id');
+    const another_channel = pc.createDataChannel('another');
+    assert_equals(another_channel.id % 2, 1, 'id');
+    assert_not_equals(channel.id, another_channel.id);
+  })
+}, "DTLS client uses odd data channel IDs");
+
+promise_test(test => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('');
+  return pc.createOffer()
+  .then(offer => pc.setLocalDescription(offer))
+  .then(() => {
+    // Turn our own offer SDP into valid answer SDP by setting the DTLS role to
+    // "passive".
+    const answer = {
+      type: "answer",
+      sdp: pc.localDescription.sdp.replace("actpass", "passive")
+    };
+    return pc.setRemoteDescription(answer);
+  })
+  .then(() => {
+    // Since the remote description had a "passive" DTLS role, we're the client
+    // and should use even data channel IDs, according to rtcweb-data-channel.
+    assert_equals(channel.id % 2, 0, 'id');
+    const another_channel = pc.createDataChannel('another');
+    assert_equals(another_channel.id % 2, 0, 'id');
+    assert_not_equals(channel.id, another_channel.id);
+  })
+}, "DTLS server uses even data channel IDs");
+
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,5 @@
+
+FAIL canTrickleIceCandidates property is null prior to setRemoteDescription assert_equals: canTrickleIceCandidates property is null expected (object) null but got (undefined) undefined
+FAIL canTrickleIceCandidates property is true after setRemoteDescription with a=ice-options:trickle assert_true: canTrickleIceCandidates property is true after setRemoteDescription expected true got undefined
+FAIL canTrickleIceCandidates property is false after setRemoteDescription without a=ice-options:trickle assert_false: canTrickleIceCandidates property is false after setRemoteDescription expected false got undefined
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,58 @@
+<!doctype html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>RTCPeerConnection canTrickleIceCandidates tests</title>
+</head>
+<body>
+  <!--  These files are in place when executing on W3C.  -->
+  <script src=""
+  <script src=""
+  <script type="text/_javascript_">
+  // tests support for RTCPeerConnection.canTrickleIceCandidates:
+  // http://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-cantrickleicecandidates
+  const sdp = 'v=0\r\n' +
+      'o=- 166855176514521964 2 IN IP4 127.0.0.1\r\n' +
+      's=-\r\n' +
+      't=0 0\r\n' +
+      'a=ice-options:trickle\r\n' +
+      'm=audio 9 UDP/TLS/RTP/SAVPF 111\r\n' +
+      'c=IN IP4 0.0.0.0\r\n' +
+      'a=rtcp:9 IN IP4 0.0.0.0\r\n' +
+      'a=ice-ufrag:someufrag\r\n' +
+      'a=ice-pwd:somelongpwdwithenoughrandomness\r\n' +
+      'a=fingerprint:sha-256 8C:71:B3:8D:A5:38:FD:8F:A4:2E:A2:65:6C:86:52:BC:E0:6E:94:F2:9F:7C:4D:B5:DF:AF:AA:6F:44:90:8D:F4\r\n' +
+      'a=setup:actpass\r\n' +
+      'a=rtcp-mux\r\n' +
+      'a=mid:mid1\r\n' +
+      'a=sendonly\r\n' +
+      'a=msid:stream1 track1\r\n' +
+      'a=ssrc:1001 cname:some\r\n' +
+      'a=rtpmap:111 opus/48000/2\r\n';
+
+  test(function() {
+    var pc = new RTCPeerConnection();
+    assert_equals(pc.canTrickleIceCandidates, null, 'canTrickleIceCandidates property is null');
+  }, 'canTrickleIceCandidates property is null prior to setRemoteDescription');
+
+  promise_test(function() {
+    var pc = new RTCPeerConnection();
+
+    return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp}))
+    .then(function() {
+      assert_true(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is true after setRemoteDescription');
+    })
+  }, 'canTrickleIceCandidates property is true after setRemoteDescription with a=ice-options:trickle');
+
+  promise_test(function() {
+    var pc = new RTCPeerConnection();
+
+    return pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp.replace('a=ice-options:trickle\r\n', '')}))
+    .then(function() {
+      assert_false(pc.canTrickleIceCandidates, 'canTrickleIceCandidates property is false after setRemoteDescription');
+    })
+  }, 'canTrickleIceCandidates property is false after setRemoteDescription without a=ice-options:trickle');
+</script>
+
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,105 @@
+
+PASS RTCPeerConnection.length 
+PASS new RTCPeerConnection() 
+PASS new RTCPeerConnection(null) 
+PASS new RTCPeerConnection(undefined) 
+PASS new RTCPeerConnection({}) 
+PASS new RTCPeerConnection({ iceServers: null }) 
+PASS new RTCPeerConnection({ iceServers: undefined }) 
+PASS new RTCPeerConnection({ iceServers: [] }) 
+PASS new RTCPeerConnection({ iceServers: [{}] }) 
+PASS new RTCPeerConnection({ iceServers: [null] }) 
+PASS new RTCPeerConnection({ iceServers: [undefined] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: "stun:stun1.example.net" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: [] }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: ["stun:stun1.example.net"] }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: ["stun:stun1.example.net", "stun:stun2.example.net"] }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: "turns:turn.example.org", username: "user", credential: "cred" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: "turn:turn.example.net", username: "user", credential: "cred" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: "turns:turn.example.org", username: "", credential: "" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: "turn:turn.example.net", username: "", credential: "" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: ["turns:turn.example.org", "turn:turn.example.net"], username: "user", credential: "cred" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: "stun:stun1.example.net", credentialType: "password" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: "stun:stun1.example.net", credentialType: "token" }] }) 
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "turn:turn.example.net" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "turn:turn.example.net", username: "user" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "turn:turn.example.net", credential: "cred" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "turns:turn.example.org" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "turns:turn.example.org", username: "user" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "turns:turn.example.org", credential: "cred" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "relative-url" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" threw object "TypeError: Error creating RTCPeerConnection" that is not a DOMException SyntaxError: property "code" is equal to undefined, expected 12
+FAIL new RTCPeerConnection({ iceServers: [{ urls: "http://example.com" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" threw object "TypeError: Error creating RTCPeerConnection" that is not a DOMException SyntaxError: property "code" is equal to undefined, expected 12
+PASS new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "password" }] }) 
+PASS new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "token" }] }) 
+FAIL new RTCPeerConnection({ iceServers: [{ urls: [], credentialType: "invalid" }] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+PASS new RTCPeerConnection({ iceServers: [{ url: "stun:stun1.example.net" }] }) 
+PASS new RTCPeerConnection({ iceTransportPolicy: null }) 
+PASS new RTCPeerConnection({ iceTransportPolicy: undefined }) 
+PASS new RTCPeerConnection({ iceTransportPolicy: "relay" }) 
+PASS new RTCPeerConnection({ iceTransportPolicy: "all" }) 
+PASS new RTCPeerConnection({ iceTransportPolicy: "invalid" }) 
+PASS new RTCPeerConnection({ iceTransportPolicy: "none" }) 
+PASS new RTCPeerConnection({ iceTransports: "invalid" }) 
+PASS new RTCPeerConnection({ iceTransports: "none" }) 
+PASS new RTCPeerConnection({ bundlePolicy: null }) 
+PASS new RTCPeerConnection({ bundlePolicy: undefined }) 
+PASS new RTCPeerConnection({ bundlePolicy: "balanced" }) 
+PASS new RTCPeerConnection({ bundlePolicy: "max-compat" }) 
+PASS new RTCPeerConnection({ bundlePolicy: "max-bundle" }) 
+PASS new RTCPeerConnection({ bundlePolicy: "invalid" }) 
+FAIL new RTCPeerConnection({ rtcpMuxPolicy: null }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+PASS new RTCPeerConnection({ rtcpMuxPolicy: undefined }) 
+PASS new RTCPeerConnection({ rtcpMuxPolicy: "negotiate" }) 
+PASS new RTCPeerConnection({ rtcpMuxPolicy: "require" }) 
+FAIL new RTCPeerConnection({ rtcpMuxPolicy: "invalid" }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ peerIdentity: toStringThrows }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ certificates: null }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+PASS new RTCPeerConnection({ certificates: undefined }) 
+PASS new RTCPeerConnection({ certificates: [] }) 
+FAIL new RTCPeerConnection({ certificates: [null] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+FAIL new RTCPeerConnection({ certificates: [undefined] }) assert_throws: function "function () {
+        eval(expr);
+      }" did not throw
+PASS new RTCPeerConnection({ iceCandidatePoolSize: toNumberThrows }) 
+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)
+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 
+PASS connectionState initial value 
+FAIL canTrickleIceCandidates initial value assert_equals: expected (object) null but got (undefined) undefined
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,156 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCPeerConnection constructor</title>
+<script src=""
+<script src=""
+<script>
+test(function() {
+  assert_equals(RTCPeerConnection.length, 0);
+}, 'RTCPeerConnection.length');
+
+// These are used for string and number dictionary members to see if they are
+// being accessed at all.
+const toStringThrows = { toString: function() { throw new Error; } };
+const toNumberThrows = Symbol();
+
+// Test the first argument of the constructor. The key is the argument itself,
+// and the value is the first argument for assert_throws, or false if no
+// exception should be thrown.
+const testArgs = {
+  // No argument or equivalent.
+  '': false,
+  'null': false,
+  'undefined': false,
+  '{}': false,
+
+  // iceServers
+  '{ iceServers: null }': new TypeError,
+  '{ iceServers: undefined }': false,
+  '{ iceServers: [] }': false,
+  '{ iceServers: [{}] }': new TypeError,
+  '{ iceServers: [null] }': new TypeError,
+  '{ iceServers: [undefined] }': new TypeError,
+  '{ iceServers: [{ urls: "stun:stun1.example.net" }] }': false,
+  '{ iceServers: [{ urls: [] }] }': false,
+  '{ iceServers: [{ urls: ["stun:stun1.example.net"] }] }': false,
+  '{ iceServers: [{ urls: ["stun:stun1.example.net", "stun:stun2.example.net"] }] }': false,
+  // username and password required for turn: and turns:
+  '{ iceServers: [{ urls: "turns:turn.example.org", username: "user", credential: "cred" }] }': false,
+  '{ iceServers: [{ urls: "turn:turn.example.net", username: "user", credential: "cred" }] }': false,
+  '{ iceServers: [{ urls: "turns:turn.example.org", username: "", credential: "" }] }': false,
+  '{ iceServers: [{ urls: "turn:turn.example.net", username: "", credential: "" }] }': false,
+  '{ iceServers: [{ urls: ["turns:turn.example.org", "turn:turn.example.net"], username: "user", credential: "cred" }] }': false,
+  '{ iceServers: [{ urls: "stun:stun1.example.net", credentialType: "password" }] }': false,
+  '{ iceServers: [{ urls: "stun:stun1.example.net", credentialType: "token" }] }': false,
+  '{ iceServers: [{ urls: "turn:turn.example.net" }] }': 'InvalidAccessError',
+  '{ iceServers: [{ urls: "turn:turn.example.net", username: "user" }] }': 'InvalidAccessError',
+  '{ iceServers: [{ urls: "turn:turn.example.net", credential: "cred" }] }': 'InvalidAccessError',
+  '{ iceServers: [{ urls: "turns:turn.example.org" }] }': 'InvalidAccessError',
+  '{ iceServers: [{ urls: "turns:turn.example.org", username: "user" }] }': 'InvalidAccessError',
+  '{ iceServers: [{ urls: "turns:turn.example.org", credential: "cred" }] }': 'InvalidAccessError',
+  '{ iceServers: [{ urls: "relative-url" }] }': 'SyntaxError',
+  '{ iceServers: [{ urls: "http://example.com" }] }': 'SyntaxError',
+  // credentialType
+  '{ iceServers: [{ urls: [] }] }': false,
+  '{ iceServers: [{ urls: [], credentialType: "password" }] }': false,
+  '{ iceServers: [{ urls: [], credentialType: "token" }] }': false,
+  '{ iceServers: [{ urls: [], credentialType: "invalid" }] }': new TypeError,
+  // Blink and Gecko fall back to url, but it's not in the spec.
+  '{ iceServers: [{ url: "stun:stun1.example.net" }] }': new TypeError,
+
+  // iceTransportPolicy
+  '{ iceTransportPolicy: null }': new TypeError,
+  '{ iceTransportPolicy: undefined }': false,
+  '{ iceTransportPolicy: "relay" }': false,
+  '{ iceTransportPolicy: "all" }': false,
+  '{ iceTransportPolicy: "invalid" }': new TypeError,
+  // "none" is in Blink and Gecko's IDL, but not in the spec.
+  '{ iceTransportPolicy: "none" }': new TypeError,
+  // iceTransportPolicy is called iceTransports in Blink.
+  '{ iceTransports: "invalid" }': false,
+  '{ iceTransports: "none" }': false,
+
+  // bundlePolicy
+  '{ bundlePolicy: null }': new TypeError,
+  '{ bundlePolicy: undefined }': false,
+  '{ bundlePolicy: "balanced" }': false,
+  '{ bundlePolicy: "max-compat" }': false,
+  '{ bundlePolicy: "max-bundle" }': false,
+  '{ bundlePolicy: "invalid" }': new TypeError,
+
+  // rtcpMuxPolicy
+  '{ rtcpMuxPolicy: null }': new TypeError,
+  '{ rtcpMuxPolicy: undefined }': false,
+  '{ rtcpMuxPolicy: "negotiate" }': false,
+  '{ rtcpMuxPolicy: "require" }': false,
+  '{ rtcpMuxPolicy: "invalid" }': new TypeError,
+
+  // peerIdentity
+  '{ peerIdentity: toStringThrows }': new Error,
+
+  // certificates
+  '{ certificates: null }': new TypeError,
+  '{ certificates: undefined }': false,
+  '{ certificates: [] }': false,
+  '{ certificates: [null] }': new TypeError,
+  '{ certificates: [undefined] }': new TypeError,
+
+  // iceCandidatePoolSize
+  '{ iceCandidatePoolSize: toNumberThrows }': new TypeError,
+}
+
+for (const arg in testArgs) {
+  const expr = 'new RTCPeerConnection(' + arg + ')';
+  test(function() {
+    const throws = testArgs[arg];
+    if (throws) {
+      assert_throws(throws, function() {
+        eval(expr);
+      });
+    } else {
+      eval(expr);
+    }
+  }, expr);
+}
+
+promise_test(function() {
+  return RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256" })
+      .then(certificate => new RTCPeerConnection({ certificates: [certificate] }));
+}, 'new RTCPeerConnection({ certificates: [certificate] })');
+
+promise_test(function() {
+  return RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256", expires: 0 })
+      .then(certificate => {
+        assert_less_than_equal(certificate.expires, Date.now());
+        assert_throws('InvalidAccessError', function() {
+          new RTCPeerConnection({ certificates: [certificate] });
+        });
+      });
+}, 'new RTCPeerConnection({ certificates: [expiredCertificate] })');
+
+// The initial values of attributes of RTCPeerConnection.
+const initialState = {
+  'localDescription': null,
+  'currentLocalDescription': null,
+  'pendingLocalDescription': null,
+  'remoteDescription': null,
+  'currentRemoteDescription': null,
+  'pendingRemoteDescription': null,
+  'signalingState': 'stable',
+  'iceGatheringState': 'new',
+  'iceConnectionState': 'new',
+  'connectionState': 'new',
+  'canTrickleIceCandidates': null,
+  // TODO: defaultIceServers
+};
+
+for (const attr in initialState) {
+  test(function() {
+    // Use one RTCPeerConnection instance for all initial value tests.
+    if (!window.pc) {
+      window.pc = new RTCPeerConnection;
+    }
+    assert_equals(pc[attr], initialState[attr]);
+  }, attr + ' initial value');
+}
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,29 @@
+
+PASS createDataChannel required arguments 
+FAIL createDataChannel with closed connection assert_equals: signaling state expected "closed" but got "stable"
+FAIL createDataChannel defaults assert_equals: priority expected (string) "low" but got (undefined) undefined
+PASS createDataChannel with label "foo" 
+FAIL createDataChannel with label null assert_equals: expected "null" but got ""
+PASS createDataChannel with label undefined 
+PASS createDataChannel with label lone surrogate 
+PASS createDataChannel with ordered false 
+PASS createDataChannel with ordered null/undefined 
+PASS createDataChannel with maxPacketLifeTime 0 
+PASS createDataChannel with maxRetransmits 0 
+FAIL createDataChannel with both maxPacketLifeTime and maxRetransmits assert_throws: function "() => pc.createDataChannel('', {
+    maxPacketLifeTime: 0,
+    maxRetransmits: 0
+  })" threw object "TypeError: Type error" that is not a DOMException SyntaxError: property "code" is equal to undefined, expected 12
+PASS createDataChannel with protocol "foo" 
+PASS createDataChannel with protocol null 
+PASS createDataChannel with protocol undefined 
+PASS createDataChannel with protocol lone surrogate 
+PASS createDataChannel with negotiated true 
+PASS createDataChannel with id -1 
+PASS createDataChannel with id 0 
+PASS createDataChannel with id 1 
+FAIL createDataChannel with id 65534 The operation is not supported.
+PASS createDataChannel with id 65535 
+PASS createDataChannel with id 65536 
+FAIL createDataChannel with priority "high" assert_equals: expected (string) "high" but got (undefined) undefined
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,129 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>RTCPeerConnection createDataChannel method</title>
+<script src=""
+<script src=""
+<script>
+'use strict';
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  assert_equals(pc.createDataChannel.length, 1);
+  assert_throws(new TypeError, () => pc.createDataChannel());
+}, 'createDataChannel required arguments');
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  pc.close();
+  assert_equals(pc.signalingState, 'closed', 'signaling state');
+  assert_throws('InvalidStateError', () => pc.createDataChannel(''));
+}, 'createDataChannel with closed connection');
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('');
+  assert_true(channel instanceof RTCDataChannel, 'is RTCDataChannel');
+  assert_equals(channel.label, '', 'label');
+  assert_equals(channel.ordered, true, 'ordered');
+  assert_equals(channel.maxPacketLifeTime, null, 'maxPacketLifeTime');
+  assert_equals(channel.maxRetransmits, null, 'maxRetransmits');
+  assert_equals(channel.protocol, '', 'protocol');
+  assert_equals(channel.negotiated, false, 'negotiated');
+  // Since no offer/answer exchange has occurred yet, the DTLS role is unknown
+  // and so the ID should be null.
+  assert_equals(channel.id, null, 'id');
+  assert_equals(channel.priority, 'low', 'priority');
+}, 'createDataChannel defaults');
+
+const labels = [
+  ['"foo"', 'foo', 'foo'],
+  ['null', null, 'null'],
+  ['undefined', undefined, 'undefined'],
+  ['lone surrogate', '\uD800', '\uFFFD'],
+];
+for (const [description, label, expected] of labels) {
+  test(() => {
+    const pc = new RTCPeerConnection;
+    const channel = pc.createDataChannel(label);
+    assert_equals(channel.label, expected);
+  }, 'createDataChannel with label ' + description);
+}
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('', { ordered: false });
+  assert_equals(channel.ordered, false);
+}, 'createDataChannel with ordered false');
+
+// true as the default value of a boolean is confusing because null is converted
+// to false while undefined is converted to true.
+test(() => {
+  const pc = new RTCPeerConnection;
+  const channel1 = pc.createDataChannel('', { ordered: null });
+  assert_equals(channel1.ordered, false);
+  const channel2 = pc.createDataChannel('', { ordered: undefined });
+  assert_equals(channel2.ordered, true);
+}, 'createDataChannel with ordered null/undefined');
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('', { maxPacketLifeTime: 0 });
+  assert_equals(channel.maxPacketLifeTime, 0);
+}, 'createDataChannel with maxPacketLifeTime 0');
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('', { maxRetransmits: 0 });
+  assert_equals(channel.maxRetransmits, 0);
+}, 'createDataChannel with maxRetransmits 0');
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  assert_throws('SyntaxError', () => pc.createDataChannel('', {
+    maxPacketLifeTime: 0,
+    maxRetransmits: 0
+  }));
+}, 'createDataChannel with both maxPacketLifeTime and maxRetransmits');
+
+const protocols = [
+  ['"foo"', 'foo', 'foo'],
+  ['null', null, 'null'],
+  ['undefined', undefined, ''],
+  ['lone surrogate', '\uD800', '\uFFFD'],
+];
+for (const [description, protocol, expected] of protocols) {
+  test(() => {
+    const pc = new RTCPeerConnection;
+    const channel = pc.createDataChannel('', { protocol: protocol });
+    assert_equals(channel.protocol, expected);
+  }, 'createDataChannel with protocol ' + description);
+}
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('', { negotiated: true });
+  assert_equals(channel.negotiated, true);
+}, 'createDataChannel with negotiated true');
+
+// |id| is an unsigned short using [EnforceRange]. Additionally,
+// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createdatachannel
+// says: "If id is equal to 65535, which is greater than the maximum allowed ID
+// of 65534 but still qualifies as an unsigned short, throw a TypeError."
+for (const id of [-1, 0, 1, 65534, 65535, 65536]) {
+  test(() => {
+    const pc = new RTCPeerConnection;
+    if (id >= 0 && id <= 65534) {
+      const channel = pc.createDataChannel('', { id: id });
+      assert_equals(channel.id, id);
+    } else {
+      assert_throws(new TypeError, () => pc.createDataChannel('', { id: id }));
+    }
+  }, 'createDataChannel with id ' + id);
+}
+
+test(() => {
+  const pc = new RTCPeerConnection;
+  const channel = pc.createDataChannel('', { priority: "high" });
+  assert_equals(channel.priority, "high");
+}, 'createDataChannel with priority "high"');
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,5 @@
+
+Harness Error (TIMEOUT), message = null
+
+TIMEOUT Tests that the ICE gathering state ends up as "completed" after applying a local offer. Test timed out
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>RTCPeerConnection ICEGatheringState tests</title>
+</head>
+<body>
+  <!--  These files are in place when executing on W3C.  -->
+  <script src=""
+  <script src=""
+  <script type="text/_javascript_">
+  async_test(function(test) {
+    var pc = new RTCPeerConnection(null);
+
+    pc._onicegatheringstatechange_ = test.step_func(function(event) {
+      if (pc.iceGatheringState === 'complete') {
+        test.done();
+      }
+    });
+    pc.createOffer({offerToReceiveAudio: 1})
+    .then(offer => pc.setLocalDescription(offer))
+    .catch(test.step_func(function(e) {
+      assert_unreached('Error ' + e.name + ': ' + e.message);
+    }));
+  }, 'Tests that the ICE gathering state ends up as "completed" after applying a local offer.');
+</script>
+
+</body>
+</html>

Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl-expected.txt (from rev 216536, trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt) (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,136 @@
+Description
+
+This test verifies the availability of the RTCPeerConnection interface.
+
+
+PASS EventTarget interface: existence and properties of interface object 
+PASS EventTarget interface object length 
+PASS EventTarget interface object name 
+PASS EventTarget interface: existence and properties of interface prototype object 
+PASS EventTarget interface: existence and properties of interface prototype object's "constructor" property 
+PASS RTCPeerConnection interface: existence and properties of interface object 
+PASS RTCPeerConnection interface object length 
+PASS RTCPeerConnection interface object name 
+PASS RTCPeerConnection interface: existence and properties of interface prototype object 
+PASS RTCPeerConnection interface: existence and properties of interface prototype object's "constructor" property 
+PASS RTCPeerConnection interface: operation createOffer(RTCOfferOptions) 
+PASS RTCPeerConnection interface: operation createAnswer(RTCAnswerOptions) 
+FAIL RTCPeerConnection interface: operation setLocalDescription(RTCSessionDescription) assert_equals: property has wrong .length expected 1 but got 0
+PASS RTCPeerConnection interface: attribute localDescription 
+PASS RTCPeerConnection interface: attribute currentLocalDescription 
+PASS RTCPeerConnection interface: attribute pendingLocalDescription 
+FAIL RTCPeerConnection interface: operation setRemoteDescription(RTCSessionDescription) assert_equals: property has wrong .length expected 1 but got 0
+PASS RTCPeerConnection interface: attribute remoteDescription 
+PASS RTCPeerConnection interface: attribute currentRemoteDescription 
+PASS RTCPeerConnection interface: attribute pendingRemoteDescription 
+PASS RTCPeerConnection interface: operation addIceCandidate(RTCIceCandidate) 
+PASS RTCPeerConnection interface: attribute signalingState 
+PASS RTCPeerConnection interface: attribute iceGatheringState 
+PASS RTCPeerConnection interface: attribute iceConnectionState 
+FAIL RTCPeerConnection interface: attribute canTrickleIceCandidates assert_true: The prototype object must have a property "canTrickleIceCandidates" expected true got false
+PASS RTCPeerConnection interface: operation getConfiguration() 
+PASS RTCPeerConnection interface: operation setConfiguration(RTCConfiguration) 
+PASS RTCPeerConnection interface: operation close() 
+PASS RTCPeerConnection interface: attribute onnegotiationneeded 
+PASS RTCPeerConnection interface: attribute onicecandidate 
+PASS RTCPeerConnection interface: attribute onsignalingstatechange 
+PASS RTCPeerConnection interface: attribute oniceconnectionstatechange 
+PASS RTCPeerConnection interface: attribute onicegatheringstatechange 
+FAIL RTCPeerConnection interface: operation createOffer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback,RTCOfferOptions) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+            fn.apply(obj, args);
+        }" did not throw
+FAIL RTCPeerConnection interface: operation setLocalDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) assert_equals: property has wrong .length expected 1 but got 0
+FAIL RTCPeerConnection interface: operation createAnswer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+            fn.apply(obj, args);
+        }" did not throw
+FAIL RTCPeerConnection interface: operation setRemoteDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) assert_equals: property has wrong .length expected 1 but got 0
+FAIL RTCPeerConnection interface: operation addIceCandidate(RTCIceCandidate,VoidFunction,RTCPeerConnectionErrorCallback) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+            fn.apply(obj, args);
+        }" did not throw
+FAIL RTCPeerConnection interface: operation getStats(MediaStreamTrack,RTCStatsCallback,RTCPeerConnectionErrorCallback) assert_throws: calling operation with this = null didn't throw TypeError function "function () {
+            fn.apply(obj, args);
+        }" did not throw
+FAIL RTCPeerConnection interface: operation generateCertificate(AlgorithmIdentifier) assert_own_property: interface object missing static operation expected property "generateCertificate" missing
+PASS RTCPeerConnection interface: operation getSenders() 
+PASS RTCPeerConnection interface: operation getReceivers() 
+PASS RTCPeerConnection interface: operation addTrack(MediaStreamTrack,MediaStream) 
+PASS RTCPeerConnection interface: operation removeTrack(RTCRtpSender) 
+PASS RTCPeerConnection interface: attribute ontrack 
+PASS RTCPeerConnection interface: operation createDataChannel(DOMString,RTCDataChannelInit) 
+PASS RTCPeerConnection interface: attribute ondatachannel 
+FAIL RTCPeerConnection interface: attribute dtmf assert_true: The prototype object must have a property "dtmf" expected true got false
+PASS RTCPeerConnection interface: operation getStats(MediaStreamTrack) 
+FAIL RTCPeerConnection interface: operation setIdentityProvider(DOMString,DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "setIdentityProvider" missing
+FAIL RTCPeerConnection interface: operation getIdentityAssertion() assert_own_property: interface prototype object missing non-static operation expected property "getIdentityAssertion" missing
+FAIL RTCPeerConnection interface: attribute peerIdentity assert_true: The prototype object must have a property "peerIdentity" expected true got false
+FAIL RTCPeerConnection interface: attribute idpLoginUrl assert_true: The prototype object must have a property "idpLoginUrl" expected true got false
+PASS RTCPeerConnection must be primary interface of pc 
+PASS Stringification of pc 
+PASS RTCPeerConnection interface: pc must inherit property "createOffer" with the proper type (0) 
+PASS RTCPeerConnection interface: calling createOffer(RTCOfferOptions) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "createAnswer" with the proper type (1) 
+PASS RTCPeerConnection interface: calling createAnswer(RTCAnswerOptions) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "setLocalDescription" with the proper type (2) 
+PASS RTCPeerConnection interface: calling setLocalDescription(RTCSessionDescription) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "localDescription" with the proper type (3) 
+PASS RTCPeerConnection interface: pc must inherit property "currentLocalDescription" with the proper type (4) 
+PASS RTCPeerConnection interface: pc must inherit property "pendingLocalDescription" with the proper type (5) 
+PASS RTCPeerConnection interface: pc must inherit property "setRemoteDescription" with the proper type (6) 
+PASS RTCPeerConnection interface: calling setRemoteDescription(RTCSessionDescription) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "remoteDescription" with the proper type (7) 
+PASS RTCPeerConnection interface: pc must inherit property "currentRemoteDescription" with the proper type (8) 
+PASS RTCPeerConnection interface: pc must inherit property "pendingRemoteDescription" with the proper type (9) 
+PASS RTCPeerConnection interface: pc must inherit property "addIceCandidate" with the proper type (10) 
+PASS RTCPeerConnection interface: calling addIceCandidate(RTCIceCandidate) on pc with too few arguments must throw TypeError 
+FAIL RTCPeerConnection interface: pc must inherit property "signalingState" with the proper type (11) Unrecognized type RTCSignalingState
+FAIL RTCPeerConnection interface: pc must inherit property "iceGatheringState" with the proper type (12) Unrecognized type RTCIceGatheringState
+FAIL RTCPeerConnection interface: pc must inherit property "iceConnectionState" with the proper type (13) Unrecognized type RTCIceConnectionState
+FAIL RTCPeerConnection interface: pc must inherit property "canTrickleIceCandidates" with the proper type (14) assert_inherits: property "canTrickleIceCandidates" not found in prototype chain
+PASS RTCPeerConnection interface: pc must inherit property "getConfiguration" with the proper type (15) 
+PASS RTCPeerConnection interface: pc must inherit property "setConfiguration" with the proper type (16) 
+PASS RTCPeerConnection interface: calling setConfiguration(RTCConfiguration) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "close" with the proper type (17) 
+FAIL RTCPeerConnection interface: pc must inherit property "onnegotiationneeded" with the proper type (18) Unrecognized type EventHandler
+FAIL RTCPeerConnection interface: pc must inherit property "onicecandidate" with the proper type (19) Unrecognized type EventHandler
+FAIL RTCPeerConnection interface: pc must inherit property "onsignalingstatechange" with the proper type (20) Unrecognized type EventHandler
+FAIL RTCPeerConnection interface: pc must inherit property "oniceconnectionstatechange" with the proper type (21) Unrecognized type EventHandler
+FAIL RTCPeerConnection interface: pc must inherit property "onicegatheringstatechange" with the proper type (22) Unrecognized type EventHandler
+PASS RTCPeerConnection interface: pc must inherit property "createOffer" with the proper type (23) 
+PASS RTCPeerConnection interface: calling createOffer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback,RTCOfferOptions) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "setLocalDescription" with the proper type (24) 
+FAIL RTCPeerConnection interface: calling setLocalDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+            fn.apply(obj, args);
+        }" did not throw
+PASS RTCPeerConnection interface: pc must inherit property "createAnswer" with the proper type (25) 
+PASS RTCPeerConnection interface: calling createAnswer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "setRemoteDescription" with the proper type (26) 
+FAIL RTCPeerConnection interface: calling setRemoteDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+            fn.apply(obj, args);
+        }" did not throw
+PASS RTCPeerConnection interface: pc must inherit property "addIceCandidate" with the proper type (27) 
+FAIL RTCPeerConnection interface: calling addIceCandidate(RTCIceCandidate,VoidFunction,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () {
+            fn.apply(obj, args);
+        }" did not throw
+PASS RTCPeerConnection interface: pc must inherit property "getStats" with the proper type (28) 
+PASS RTCPeerConnection interface: calling getStats(MediaStreamTrack,RTCStatsCallback,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "generateCertificate" with the proper type (29) 
+FAIL RTCPeerConnection interface: calling generateCertificate(AlgorithmIdentifier) on pc with too few arguments must throw TypeError assert_unreached: Throws "TypeError: undefined is not an object (evaluating 'fn.apply')" instead of rejecting promise Reached unreachable code
+PASS RTCPeerConnection interface: pc must inherit property "getSenders" with the proper type (30) 
+PASS RTCPeerConnection interface: pc must inherit property "getReceivers" with the proper type (31) 
+PASS RTCPeerConnection interface: pc must inherit property "addTrack" with the proper type (32) 
+PASS RTCPeerConnection interface: calling addTrack(MediaStreamTrack,MediaStream) on pc with too few arguments must throw TypeError 
+PASS RTCPeerConnection interface: pc must inherit property "removeTrack" with the proper type (33) 
+PASS RTCPeerConnection interface: calling removeTrack(RTCRtpSender) on pc with too few arguments must throw TypeError 
+FAIL RTCPeerConnection interface: pc must inherit property "ontrack" with the proper type (34) Unrecognized type EventHandler
+PASS RTCPeerConnection interface: pc must inherit property "createDataChannel" with the proper type (35) 
+PASS RTCPeerConnection interface: calling createDataChannel(DOMString,RTCDataChannelInit) on pc with too few arguments must throw TypeError 
+FAIL RTCPeerConnection interface: pc must inherit property "ondatachannel" with the proper type (36) Unrecognized type EventHandler
+FAIL RTCPeerConnection interface: pc must inherit property "dtmf" with the proper type (37) assert_inherits: property "dtmf" not found in prototype chain
+PASS RTCPeerConnection interface: pc must inherit property "getStats" with the proper type (38) 
+PASS RTCPeerConnection interface: calling getStats(MediaStreamTrack) on pc with too few arguments must throw TypeError 
+FAIL RTCPeerConnection interface: pc must inherit property "setIdentityProvider" with the proper type (39) assert_inherits: property "setIdentityProvider" not found in prototype chain
+FAIL RTCPeerConnection interface: calling setIdentityProvider(DOMString,DOMString,DOMString) on pc with too few arguments must throw TypeError assert_inherits: property "setIdentityProvider" not found in prototype chain
+FAIL RTCPeerConnection interface: pc must inherit property "getIdentityAssertion" with the proper type (40) assert_inherits: property "getIdentityAssertion" not found in prototype chain
+FAIL RTCPeerConnection interface: pc must inherit property "peerIdentity" with the proper type (41) assert_inherits: property "peerIdentity" not found in prototype chain
+FAIL RTCPeerConnection interface: pc must inherit property "idpLoginUrl" with the proper type (42) assert_inherits: property "idpLoginUrl" not found in prototype chain
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,107 @@
+<!doctype html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>IDL check of RTCPeerConnection</title>
+<link rel="author" title="Harald Alvestrand" href=""
+<link rel="help" href=""
+</head>
+<body>
+
+<h1 class="instructions">Description</h1>
+<p class="instructions">This test verifies the availability of the RTCPeerConnection interface.</p>
+<div id='log'></div>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+
+<!--  The IDL is copied from the 22 September 2015 editors' draft.  -->
+<script type="text/plain">
+interface EventTarget {
+    // Only a dummy definition is needed here.
+};
+[ Constructor (optional RTCConfiguration configuration)]
+interface RTCPeerConnection : EventTarget  {
+    Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions options);
+    Promise<RTCSessionDescription> createAnswer (optional RTCAnswerOptions options);
+    Promise<void>                  setLocalDescription (RTCSessionDescription description);
+    readonly    attribute RTCSessionDescription? localDescription;
+    readonly    attribute RTCSessionDescription? currentLocalDescription;
+    readonly    attribute RTCSessionDescription? pendingLocalDescription;
+    Promise<void>                  setRemoteDescription (RTCSessionDescription description);
+    readonly    attribute RTCSessionDescription? remoteDescription;
+    readonly    attribute RTCSessionDescription? currentRemoteDescription;
+    readonly    attribute RTCSessionDescription? pendingRemoteDescription;
+    Promise<void>                  addIceCandidate (RTCIceCandidate candidate);
+    readonly    attribute RTCSignalingState      signalingState;
+    readonly    attribute RTCIceGatheringState   iceGatheringState;
+    readonly    attribute RTCIceConnectionState  iceConnectionState;
+    readonly    attribute boolean?               canTrickleIceCandidates;
+    RTCConfiguration               getConfiguration ();
+    void                           setConfiguration (RTCConfiguration configuration);
+    void                           close ();
+                attribute EventHandler           onnegotiationneeded;
+                attribute EventHandler           onicecandidate;
+                attribute EventHandler           onsignalingstatechange;
+                attribute EventHandler           oniceconnectionstatechange;
+                attribute EventHandler           onicegatheringstatechange;
+};
+
+partial interface RTCPeerConnection {
+    void createOffer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback, optional RTCOfferOptions options);
+    void setLocalDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
+    void createAnswer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
+    void setRemoteDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
+    void addIceCandidate (RTCIceCandidate candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
+    void getStats (MediaStreamTrack? selector, RTCStatsCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
+};
+
+partial interface RTCPeerConnection {
+    static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
+};
+
+partial interface RTCPeerConnection {
+    sequence<RTCRtpSender>   getSenders ();
+    sequence<RTCRtpReceiver> getReceivers ();
+    RTCRtpSender             addTrack (MediaStreamTrack track, MediaStream... streams);
+    void                     removeTrack (RTCRtpSender sender);
+                attribute EventHandler ontrack;
+};
+
+partial interface RTCPeerConnection {
+    RTCDataChannel createDataChannel ([TreatNullAs=EmptyString] DOMString label, optional RTCDataChannelInit dataChannelDict);
+                attribute EventHandler ondatachannel;
+};
+
+partial interface RTCPeerConnection {
+    readonly    attribute RTCDTMFSender? dtmf;
+};
+
+partial interface RTCPeerConnection {
+    Promise<RTCStatsReport> getStats (optional MediaStreamTrack? selector);
+};
+
+partial interface RTCPeerConnection {
+    void               setIdentityProvider (DOMString provider, optional DOMString protocol, optional DOMString usernameHint);
+    Promise<DOMString> getIdentityAssertion ();
+    readonly    attribute Promise<RTCIdentityAssertion> peerIdentity;
+    readonly    attribute DOMString?                    idpLoginUrl;
+};
+
+</script>
+<script>
+(function() {
+  var idl_array = new IdlArray();
+  [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"),
+                  function(node) {
+                    idl_array.add_idls(node.textContent);
+                  });
+  window.pc = new RTCPeerConnection(null);
+  idl_array.add_objects({"RTCPeerConnection": ["pc"]});
+  idl_array.test();
+  done();
+})();
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,6 @@
+
+PASS Triggers ontrack when called with a remote description and the MSID of the stream is is parsed. 
+FAIL Malformed SDP description should be rejected with RTCError Can't find variable: RTCError
+PASS Invalid SDP type should be rejected with TypeError 
+FAIL SDP type that is invalid for current signaling state should be rejected with InvalidStateError Can't find variable: InvalidStateError
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,88 @@
+<!doctype html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>RTCPeerConnection setRemoteDescription tests</title>
+</head>
+<body>
+  <!--  These files are in place when executing on W3C.  -->
+  <script src=""
+  <script src=""
+  <script type="text/_javascript_">
+  'use strict';
+
+  // tests that ontrack is called and parses the msid information from the SDP and creates
+  // the streams with matching identifiers.
+  async_test(function(test) {
+    const sdp = 'v=0\r\n' +
+        'o=- 166855176514521964 2 IN IP4 127.0.0.1\r\n' +
+        's=-\r\n' +
+        't=0 0\r\n' +
+        'a=msid-semantic:WMS *\r\n' +
+        'm=audio 9 UDP/TLS/RTP/SAVPF 111\r\n' +
+        'c=IN IP4 0.0.0.0\r\n' +
+        'a=rtcp:9 IN IP4 0.0.0.0\r\n' +
+        'a=ice-ufrag:someufrag\r\n' +
+        'a=ice-pwd:somelongpwdwithenoughrandomness\r\n' +
+        'a=fingerprint:sha-256 8C:71:B3:8D:A5:38:FD:8F:A4:2E:A2:65:6C:86:52:BC:E0:6E:94:F2:9F:7C:4D:B5:DF:AF:AA:6F:44:90:8D:F4\r\n' +
+        'a=setup:actpass\r\n' +
+        'a=rtcp-mux\r\n' +
+        'a=mid:mid1\r\n' +
+        'a=sendonly\r\n' +
+        'a=rtpmap:111 opus/48000/2\r\n' +
+        'a=msid:stream1 track1\r\n' +
+        'a=ssrc:1001 cname:some\r\n';
+
+    var pc = new RTCPeerConnection(null);
+
+    pc._ontrack_ = test.step_func(function(event) {
+      assert_equals(event.streams.length, 1, 'the track belongs to one MediaStream');
+      assert_equals(event.streams[0].id, 'stream1', 'the stream name is parsed from the MSID line');
+      test.done();
+    });
+
+    pc.setRemoteDescription(new RTCSessionDescription({type: 'offer', sdp: sdp}))
+    .catch(test.step_func(function(e) {
+      assert_unreached('Error ' + e.name + ': ' + e.message);
+    }));
+  }, 'Triggers ontrack when called with a remote description and the MSID of the stream is is parsed.');
+
+  promise_test(t => {
+    const pc = new RTCPeerConnection();
+    return promise_rejects(t, new RTCError(),
+      pc.setRemoteDescription({
+        // valid SDP type
+        type: 'offer',
+        // malformed SDP description
+        sdp: 'bogus'
+      }));
+  }, 'Malformed SDP description should be rejected with RTCError');
+
+  promise_test(t => {
+    const pc = new RTCPeerConnection();
+    return promise_rejects(t, new TypeError(),
+      pc.setRemoteDescription({
+        // invalid enum value is caught at IDL level before
+        // method is executed
+        type: 'bogus',
+        // bogus SDP should never be validated before type
+        sdp: 'bogus'
+      }));
+  }, 'Invalid SDP type should be rejected with TypeError');
+
+  promise_test(t => {
+    const pc = new RTCPeerConnection();
+
+    return promise_rejects(t, new InvalidStateError(),
+      pc.setRemoteDescription({
+        // a new connection with stable state cannot accept answer type SDP
+        type: 'answer',
+        // bogus SDP should never be validated before validating type
+        sdp: 'bogus'
+      }));
+  }, 'SDP type that is invalid for current signaling state should be rejected with InvalidStateError');
+
+</script>
+
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-idlharness-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-idlharness-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-idlharness-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,61 @@
+
+FAIL RTCDataChannel interface: existence and properties of interface object undefined is not an object (evaluating 'this.array
+                     .members[this.base]
+                     .has_extended_attribute')
+PASS RTCDataChannel interface object length 
+PASS RTCDataChannel interface object name 
+FAIL RTCDataChannel interface: existence and properties of interface prototype object undefined is not an object (evaluating 'this.array
+                         .members[inherit_interface]
+                         .has_extended_attribute')
+PASS RTCDataChannel interface: existence and properties of interface prototype object's "constructor" property 
+PASS RTCDataChannel interface: attribute label 
+PASS RTCDataChannel interface: attribute ordered 
+PASS RTCDataChannel interface: attribute maxPacketLifeTime 
+PASS RTCDataChannel interface: attribute maxRetransmits 
+PASS RTCDataChannel interface: attribute protocol 
+PASS RTCDataChannel interface: attribute negotiated 
+PASS RTCDataChannel interface: attribute id 
+FAIL RTCDataChannel interface: attribute priority assert_true: The prototype object must have a property "priority" expected true got false
+PASS RTCDataChannel interface: attribute readyState 
+PASS RTCDataChannel interface: attribute bufferedAmount 
+PASS RTCDataChannel interface: attribute bufferedAmountLowThreshold 
+PASS RTCDataChannel interface: attribute onopen 
+PASS RTCDataChannel interface: attribute onbufferedamountlow 
+PASS RTCDataChannel interface: attribute onerror 
+PASS RTCDataChannel interface: attribute onclose 
+PASS RTCDataChannel interface: operation close() 
+PASS RTCDataChannel interface: attribute onmessage 
+PASS RTCDataChannel interface: attribute binaryType 
+PASS RTCDataChannel interface: operation send(USVString) 
+PASS RTCDataChannel interface: operation send(Blob) 
+PASS RTCDataChannel interface: operation send(ArrayBuffer) 
+PASS RTCDataChannel interface: operation send(ArrayBufferView) 
+PASS RTCDataChannel must be primary interface of channel 
+FAIL Stringification of channel undefined is not an object (evaluating 'this.array.members[this.base].has_stringifier')
+PASS RTCDataChannel interface: channel must inherit property "label" with the proper type (0) 
+PASS RTCDataChannel interface: channel must inherit property "ordered" with the proper type (1) 
+PASS RTCDataChannel interface: channel must inherit property "maxPacketLifeTime" with the proper type (2) 
+PASS RTCDataChannel interface: channel must inherit property "maxRetransmits" with the proper type (3) 
+PASS RTCDataChannel interface: channel must inherit property "protocol" with the proper type (4) 
+PASS RTCDataChannel interface: channel must inherit property "negotiated" with the proper type (5) 
+FAIL RTCDataChannel interface: channel must inherit property "id" with the proper type (6) assert_equals: expected "number" but got "object"
+FAIL RTCDataChannel interface: channel must inherit property "priority" with the proper type (7) assert_inherits: property "priority" not found in prototype chain
+PASS RTCDataChannel interface: channel must inherit property "readyState" with the proper type (8) 
+PASS RTCDataChannel interface: channel must inherit property "bufferedAmount" with the proper type (9) 
+PASS RTCDataChannel interface: channel must inherit property "bufferedAmountLowThreshold" with the proper type (10) 
+FAIL RTCDataChannel interface: channel must inherit property "onopen" with the proper type (11) Unrecognized type EventHandler
+FAIL RTCDataChannel interface: channel must inherit property "onbufferedamountlow" with the proper type (12) Unrecognized type EventHandler
+FAIL RTCDataChannel interface: channel must inherit property "onerror" with the proper type (13) Unrecognized type EventHandler
+FAIL RTCDataChannel interface: channel must inherit property "onclose" with the proper type (14) Unrecognized type EventHandler
+PASS RTCDataChannel interface: channel must inherit property "close" with the proper type (15) 
+FAIL RTCDataChannel interface: channel must inherit property "onmessage" with the proper type (16) Unrecognized type EventHandler
+PASS RTCDataChannel interface: channel must inherit property "binaryType" with the proper type (17) 
+PASS RTCDataChannel interface: channel must inherit property "send" with the proper type (18) 
+PASS RTCDataChannel interface: calling send(USVString) on channel with too few arguments must throw TypeError 
+PASS RTCDataChannel interface: channel must inherit property "send" with the proper type (19) 
+PASS RTCDataChannel interface: calling send(Blob) on channel with too few arguments must throw TypeError 
+PASS RTCDataChannel interface: channel must inherit property "send" with the proper type (20) 
+PASS RTCDataChannel interface: calling send(ArrayBuffer) on channel with too few arguments must throw TypeError 
+PASS RTCDataChannel interface: channel must inherit property "send" with the proper type (21) 
+PASS RTCDataChannel interface: calling send(ArrayBufferView) on channel with too few arguments must throw TypeError 
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,75 @@
+<!doctype html>
+<!-- 
+This test creates a data channel object and compares it with the WebIDL defined interface
+ -->
+
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>RTCPeerConnection Data Channel Empty String Test</title>
+  <link rel="author" title="Dominique Hazael-Massieux" href=""
+  <link rel="help" href=""
+</head>
+<body>
+  <div id="log"></div>
+  <!--  These files are in place when executing on W3C.  -->
+  <script src=""
+  <script src=""
+  <script src=""
+  <script src=""
+  <!--  The IDL is copied from https://w3c.github.io/webrtc-pc/archives/20161219/webrtc.html  -->
+  <script type="text/plain">
+interface RTCDataChannel : EventTarget {
+    readonly attribute USVString           label;
+    readonly attribute boolean             ordered;
+    readonly attribute unsigned short?     maxPacketLifeTime;
+    readonly attribute unsigned short?     maxRetransmits;
+    readonly attribute USVString           protocol;
+    readonly attribute boolean             negotiated;
+    readonly attribute unsigned short      id;
+    readonly attribute RTCPriorityType     priority;
+    readonly attribute RTCDataChannelState readyState;
+    readonly attribute unsigned long       bufferedAmount;
+             attribute unsigned long       bufferedAmountLowThreshold;
+             attribute EventHandler        onopen;
+             attribute EventHandler        onbufferedamountlow;
+             attribute EventHandler        onerror;
+             attribute EventHandler        onclose;
+    void close();
+             attribute EventHandler        onmessage;
+             attribute DOMString           binaryType;
+    void send(USVString data);
+    void send(Blob data);
+    void send(ArrayBuffer data);
+    void send(ArrayBufferView data);
+};
+enum RTCPriorityType {
+    "very-low",
+    "low",
+    "medium",
+    "high"
+};
+enum RTCDataChannelState {
+    "connecting",
+    "open",
+    "closing",
+    "closed"
+};
+</script>
+  <script type="text/_javascript_">
+    (function() {
+  var idl_array = new IdlArray();
+  [].forEach.call(document.querySelectorAll("script[type=text\\/plain]"),
+                  function(node) {
+                    idl_array.add_idls(node.textContent);
+                  });
+    pc = new RTCPeerConnection(null);
+    window.channel = pc.createDataChannel("test");
+  idl_array.add_objects({"RTCDataChannel": ["channel"]});
+  idl_array.test();
+  done();
+})();
+</script>
+</body>
+</html>
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/getstats-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/getstats-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/getstats-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,9 @@
+
+FAIL Can get stats from a basic WebRTC call. assert_unreached: Error: assert_not_equals: Did not find peer-connection stats got disallowed value null:  Reached unreachable code
+Retrieved stats info
+
+  
+
+  
+
+  

Copied: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/getstats.html (from rev 216536, trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call.html) (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/getstats.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/getstats.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,129 @@
+<!doctype html>
+<!-- 
+This test uses data only, and thus does not require fake media devices.
+ -->
+
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>RTCPeerConnection GetStats</title>
+</head>
+<body>
+  <div id="log"></div>
+  <h2>Retrieved stats info</h2>
+  <pre>
+  <div id="stats">
+  </div>
+  </pre>
+
+  <!--  These files are in place when executing on W3C.  -->
+  <script src=""
+  <script src=""
+  <script type="text/_javascript_">
+  var test = async_test('Can get stats from a basic WebRTC call.');
+
+  var gFirstConnection = null;
+  var gSecondConnection = null;
+
+  var _onIceCandidateToFirst_ = test.step_func(function(event) {
+    // If event.candidate is null = no more candidates.
+    if (event.candidate) {
+      gSecondConnection.addIceCandidate(event.candidate);
+    }
+  });
+
+  var _onIceCandidateToSecond_ = test.step_func(function(event) {
+    if (event.candidate) {
+      gFirstConnection.addIceCandidate(event.candidate);
+    }
+  });
+
+  var _onRemoteStream_ = test.step_func(function(event) {
+    assert_unreached('WebRTC received a stream when there was none');
+  });
+
+  var getStatsRecordByType = function(stats, type) {
+    for (let stat of stats.values()) {
+      if (stat.type == type) {
+        return stat;
+      }
+    }
+    return null;
+  }
+
+  var _onIceConnectionStateChange_ = test.step_func(function(event) {
+    // Wait until connection is established.
+    // Note - not all browsers reach 'completed' state, so we're
+    // checking for 'connected' state instead.
+    if (gFirstConnection.iceConnectionState != 'connected') {
+      return;
+    }
+    gFirstConnection.getStats()
+    .then(function(report) {
+      // Show the retrieved stats info
+      var showStats = document.getElementById('stats');
+      let reportDictionary = {};
+      for (let stats of report.values()) {
+        reportDictionary[stats.id] = stats;
+      }
+      // Check the stats properties.
+      assert_not_equals(report, null);
+      let sessionStat = getStatsRecordByType(report, 'peer-connection');
+      assert_not_equals(sessionStat, null, 'Did not find peer-connection stats');
+      assert_exists(sessionStat, 'dataChannelsOpened');
+      assert_equals(sessionStat.dataChannelsOpened, 1);
+      test.done();
+    })
+    .catch(test.step_func(function(e) {
+      assert_unreached(e.name + ': ' + e.message + ': ');
+    }));
+  });
+
+  // This function starts the test.
+  test.step(function() {
+    gFirstConnection = new RTCPeerConnection(null);
+    gFirstConnection._onicecandidate_ = onIceCandidateToFirst;
+    gFirstConnection._oniceconnectionstatechange_ = onIceConnectionStateChange;
+
+    gSecondConnection = new RTCPeerConnection(null);
+    gSecondConnection._onicecandidate_ = onIceCandidateToSecond;
+    gSecondConnection._onaddstream_ = onRemoteStream;
+
+    // The createDataChannel is necessary and sufficient to make
+    // sure the ICE connection be attempted.
+    gFirstConnection.createDataChannel('channel');
+
+    var atStep = 'Create offer';
+
+    gFirstConnection.createOffer()
+    .then(function(offer) {
+      atStep = 'Set local description at first';
+      return gFirstConnection.setLocalDescription(offer);
+    })
+    .then(function() {
+      atStep = 'Set remote description at second';
+      return gSecondConnection.setRemoteDescription(
+          gFirstConnection.localDescription);
+    })
+    .then(function() {
+      atStep = 'Create answer';
+      return gSecondConnection.createAnswer();
+    })
+    .then(function(answer) {
+      atStep = 'Set local description at second';
+      return gSecondConnection.setLocalDescription(answer);
+    })
+    .then(function() {
+      atStep = 'Set remote description at first';
+      return gFirstConnection.setRemoteDescription(
+          gSecondConnection.localDescription);
+    })
+    .catch(test.step_func(function(e) {
+      assert_unreached('Error ' + e.name + ': ' + e.message +
+                       ' happened at step ' + atStep);
+    }));
+  });
+</script>
+
+</body>
+</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces-expected.txt (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,25 @@
+
+FAIL Test driver promise_test: Unhandled rejection with value: object "Unrecognised tokens, line 1 (tokens: '{"error": {')
+[
+    {
+        "type": "other",
+        "value": "{"
+    },
+    {
+        "type": "string",
+        "value": "\"error\""
+    },
+    {
+        "type": "other",
+        "value": ":"
+    },
+    {
+        "type": "whitespace",
+        "value": " "
+    },
+    {
+        "type": "other",
+        "value": "{"
+    }
+]"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces.html (0 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -0,0 +1,57 @@
+<!doctype html>
+<html>
+  <head>
+    <title>WebRTC IDL Tests</title>
+  </head>
+  <body>
+    <script src=""
+    <script src=""
+    <script src=""
+    <script src=""
+    <script>
+      'use strict';
+
+      function generateCertificate() {
+        if (!RTCPeerConnection.generateCertificate)
+          return null;
+        return RTCPeerConnection.generateCertificate({
+          name: 'RSASSA-PKCS1-v1_5',
+          modulusLength: 2048,
+          publicExponent: new Uint8Array([1, 0, 1]),
+          hash: 'SHA-256'
+        })
+        .catch(() => {}); // ignore error
+      }
+
+      function doIdlTest([idlText, certificate]) {
+        const idlArray = new IdlArray();
+
+        idlArray.add_untested_idls('interface EventHandler {};');
+        idlArray.add_untested_idls('interface MediaStreamTrack {};');
+        idlArray.add_idls(idlText);
+
+        // TODO: Add object for all IDL interfaces
+        idlArray.add_objects({
+          'RTCPeerConnection': ['new RTCPeerConnection'],
+          'RTCSessionDescription': ['new RTCSessionDescription({ type: "offer" })'],
+          'RTCIceCandidate': ['new RTCIceCandidate'],
+          'RTCPeerConnectionIceEvent': ['new RTCPeerConnectionIceEvent("ice")'],
+          'RTCPeerConnectionIceErrorEvent': ['new RTCPeerConnectionIceErrorEvent("ice-error", { errorCode: 701 });'],
+        });
+
+        if (certificate) {
+          window.certificate = certificate;
+          idlArray.add_objects({'RTCCertificate': ['certificate']});
+        }
+
+        idlArray.test();
+      }
+
+      promise_test(() => {
+        return Promise.all([fetch('/interfaces/webrtc-pc.idl').then(response => response.text()),
+                            generateCertificate()])
+                      .then(doIdlTest);
+      }, 'Test driver');
+    </script>
+  </body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call.html (216536 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call.html	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -73,10 +73,6 @@
     }
   });
 
-  var _onRemoteStream_ = test.step_func(function(event) {
-    assert_unreached('WebRTC received a stream when there was none');
-  });
-
   var _onIceConnectionStateChange_ = test.step_func(function(event) {
     assert_equals(event.type, 'iceconnectionstatechange');
     assert_not_equals(gFirstConnection.iceConnectionState, "failed", "iceConnectionState of first connection");
@@ -125,7 +121,6 @@
 
     gSecondConnection = new RTCPeerConnection(null);
     gSecondConnection._onicecandidate_ = onIceCandidateToSecond;
-    gSecondConnection._onaddstream_ = onRemoteStream;
     gSecondConnection._oniceconnectionstatechange_ = onIceConnectionStateChange;
 
     // The offerToReceiveVideo is necessary and sufficient to make

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call.html (216536 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call.html	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -36,10 +36,6 @@
     }
   });
 
-  var _onRemoteStream_ = test.step_func(function(event) {
-    assert_unreached('WebRTC received a stream when there was none');
-  });
-
   var _onIceConnectionStateChange_ = test.step_func(function(event) {
     assert_equals(event.type, 'iceconnectionstatechange');
     var stateinfo = document.getElementById('stateinfo');
@@ -75,7 +71,6 @@
 
     gSecondConnection = new RTCPeerConnection(null);
     gSecondConnection._onicecandidate_ = onIceCandidateToSecond;
-    gSecondConnection._onaddstream_ = onRemoteStream;
     gSecondConnection._oniceconnectionstatechange_ = onIceConnectionStateChange;
 
     // The createDataChannel is necessary and sufficient to make

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt (216536 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt	2017-05-09 20:58:04 UTC (rev 216537)
@@ -1,17 +1,8 @@
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.createOffer on instances of RTCPeerConnection
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.createAnswer on instances of RTCPeerConnection
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.addIceCandidate on instances of RTCPeerConnection
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Can only call RTCPeerConnection.getStats on instances of RTCPeerConnection
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
-CONSOLE MESSAGE: line 1: Unhandled Promise Rejection: TypeError: Not enough arguments
 Description
 
 This test verifies the availability of the RTCPeerConnection interface.
 
 
-Harness Error (FAIL), message = Not enough arguments
-
 PASS EventTarget interface: existence and properties of interface object 
 PASS EventTarget interface object length 
 PASS EventTarget interface object name 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/simplecall.html (216536 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/simplecall.html	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/simplecall.html	2017-05-09 20:58:04 UTC (rev 216537)
@@ -47,7 +47,9 @@
   function getUserMediaOkCallback(localStream) {
     gFirstConnection = new RTCPeerConnection(null);
     gFirstConnection._onicecandidate_ = onIceCandidateToFirst;
-    gFirstConnection.addStream(localStream);
+    localStream.getTracks().forEach(function(track) {
+      gFirstConnection.addTrack(track, localStream);
+    });
     gFirstConnection.createOffer(onOfferCreated, failed('createOffer'));
 
     var videoTag = document.getElementById('local-view');
@@ -65,7 +67,7 @@
   function receiveCall(offerSdp) {
     gSecondConnection = new RTCPeerConnection(null);
     gSecondConnection._onicecandidate_ = onIceCandidateToSecond;
-    gSecondConnection._onaddstream_ = onRemoteStream;
+    gSecondConnection._ontrack_ = onRemoteTrack;
 
     var parsedOffer = new RTCSessionDescription({ type: 'offer',
                                                   sdp: offerSdp });
@@ -97,9 +99,11 @@
     gFirstConnection.addIceCandidate(event.candidate);
   });
 
-  var _onRemoteStream_ = test.step_func(function(event) {
+  var _onRemoteTrack_ = test.step_func(function(event) {
     var videoTag = document.getElementById('remote-view');
-    videoTag.srcObject = event.stream;
+    if (!videoTag.srcObject) {
+      videoTag.srcObject = event.streams[0];
+    }
   });
 
   // Returns a suitable error callback.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/w3c-import.log (216536 => 216537)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/w3c-import.log	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/w3c-import.log	2017-05-09 20:58:04 UTC (rev 216537)
@@ -15,9 +15,20 @@
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/webrtc/OWNERS
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html
 /LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannelEvent-constructor.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html
 /LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnectionIceEvent-constructor.html
 /LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-emptystring.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/getstats.html
+/LayoutTests/imported/w3c/web-platform-tests/webrtc/interfaces.html
 /LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call.html
 /LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call.html
 /LayoutTests/imported/w3c/web-platform-tests/webrtc/simplecall.html

Modified: trunk/Source/WebCore/ChangeLog (216536 => 216537)


--- trunk/Source/WebCore/ChangeLog	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/Source/WebCore/ChangeLog	2017-05-09 20:58:04 UTC (rev 216537)
@@ -1,3 +1,25 @@
+2017-05-09  Youenn Fablet  <[email protected]>
+
+        Refresh webrtc WPT tests
+        https://bugs.webkit.org/show_bug.cgi?id=171878
+
+        Reviewed by Eric Carlson.
+
+        Tests: imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html
+               imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html
+               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
+               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html
+               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html
+               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html
+               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html
+               imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html
+               imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html
+               imported/w3c/web-platform-tests/webrtc/getstats.html
+               imported/w3c/web-platform-tests/webrtc/interfaces.html
+
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        (WebCore::LibWebRTCMediaEndpoint::createDataChannel): exiting early if libwebrtc is not creating a data channel.
+
 2017-05-09  Javier Fernandez  <[email protected]>
 
         space-evenly misbehaves with flexbox

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp (216536 => 216537)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2017-05-09 20:48:20 UTC (rev 216536)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	2017-05-09 20:58:04 UTC (rev 216537)
@@ -576,7 +576,11 @@
     if (options.id)
         init.id = *options.id;
 
-    return std::make_unique<LibWebRTCDataChannelHandler>(m_backend->CreateDataChannel(label.utf8().data(), &init));
+    auto channel = m_backend->CreateDataChannel(label.utf8().data(), &init);
+    if (!channel)
+        return nullptr;
+
+    return std::make_unique<LibWebRTCDataChannelHandler>(WTFMove(channel));
 }
 
 void LibWebRTCMediaEndpoint::addDataChannel(rtc::scoped_refptr<webrtc::DataChannelInterface>&& dataChannel)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to