Title: [212812] trunk
Revision
212812
Author
achristen...@apple.com
Date
2017-02-21 23:59:59 -0800 (Tue, 21 Feb 2017)

Log Message

[WebRTC][Mac] Activate libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=167293
LayoutTests/imported/w3c:

<rdar://problem/30401864>

Patch by Youenn Fablet <youe...@gmail.com> on 2017-02-21
Reviewed by Alex Christensen.

* web-platform-tests/webrtc/datachannel-emptystring-expected.txt:
* web-platform-tests/webrtc/no-media-call-expected.txt:
* web-platform-tests/webrtc/promises-call-expected.txt:

Source/_javascript_Core:

<rdar://problem/30401864>

Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/FeatureDefines.xcconfig:

Source/ThirdParty/libwebrtc:

<rdar://problem/30401864>

Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Doing some clean-up.

* Configurations/libwebrtc.xcconfig:
* Source/webrtc/base/checks.h:
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:


Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:
* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:


Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

<rdar://problem/30401864>

Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

<rdar://problem/30401864>

Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.

* Configurations/WebKit.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/WebPreferences.cpp:
(WebKit::checkWebRTCAvailability):

Source/WTF:


Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* wtf/Platform.h:

Tools:

<rdar://problem/30401864>

Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

Fixing paths to allow loading libwebrtc.dylib successfully.

* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(setupMacWebKitEnvironment):
(setupIOSWebKitEnvironment):
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

<rdar://problem/30401864>

Patch by Youenn Fablet <you...@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* TestExpectations:
* fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:
* fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt:
* fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt:
* fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt:
* platform/gtk/TestExpectations:
* platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt.
* platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added.
* platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt: Added.
* platform/gtk/fast/mediastream/no-media-call-expected.txt: Added.
* platform/ios-simulator-wk2/TestExpectations:
* platform/mac-wk1/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (212811 => 212812)


--- trunk/LayoutTests/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,31 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+        <rdar://problem/30401864>
+
+        Reviewed by Alex Christensen.
+
+        * TestExpectations:
+        * fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt:
+        * fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt:
+        * fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt:
+        * fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt:
+        * platform/gtk/TestExpectations:
+        * platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt: Added.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt: Added.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt: Added.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt: Copied from LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt: Added.
+        * platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt: Added.
+        * platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt: Added.
+        * platform/gtk/fast/mediastream/no-media-call-expected.txt: Added.
+        * platform/ios-simulator-wk2/TestExpectations:
+        * platform/mac-wk1/TestExpectations:
+
 2017-02-21  Per Arne Vollan  <pvol...@apple.com>
 
         Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering.

Modified: trunk/LayoutTests/TestExpectations (212811 => 212812)


--- trunk/LayoutTests/TestExpectations	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/TestExpectations	2017-02-22 07:59:59 UTC (rev 212812)
@@ -692,6 +692,14 @@
 # WebRTC backend not enabled by default.
 webrtc [ Skip ]
 fast/mediastream/getUserMedia-webaudio.html [ Skip ]
+fast/mediastream/RTCPeerConnection-AddRemoveStream.html [ Skip ]
+fast/mediastream/RTCPeerConnection-closed-state.html [ Skip ]
+fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html [ Skip ]
+fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html [ Skip ]
+fast/mediastream/RTCPeerConnection-onnegotiationneeded.html [ Skip ]
+fast/mediastream/RTCPeerConnection-overloaded-operations-params.html [ Skip ]
+fast/mediastream/RTCRtpSender-replaceTrack.html [ Skip ]
+fast/mediastream/RTCPeerConnection-icecandidate-event.html [ Pass Failure ]
 
 # Only iOS WK1 has testRunner.setPagePaused.
 fast/dom/timer-fire-after-page-pause.html [ Skip ]

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt (212811 => 212812)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -11,23 +11,7 @@
 
 *** Define sdpMid, badSdpMid, sdpMLineIndex and badSdpMLineIndex for testing
 PASS sdpMLineIndex is not badSdpMLineIndex
-PASS sdpMid is not null
-PASS sdpMid is not badSdpMid
-PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid})) rejected with OperationError (DOM Exception 34): sdpMid did not match any media description
-PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: badSdpMLineIndex})) rejected with OperationError (DOM Exception 34): sdpMLineIndex is out of range
-*** A (bad) sdpMid takes precedesce over valid sdpMLineIndex
-PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid, sdpMLineIndex: sdpMLineIndex})) rejected with OperationError (DOM Exception 34): sdpMid did not match any media description
-*** Test bad candidate content with valid sdpMid
-PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'bad content', sdpMid: sdpMid})) rejected with OperationError (DOM Exception 34): Invalid candidate content
-*** Test bad candidate content with valid sdpMLineIndex
-PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'bad content', sdpMLineIndex: sdpMLineIndex})) rejected with OperationError (DOM Exception 34): Invalid candidate content
-
-*** Test some OK input
-PASS promise pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid}) fulfilled with undefined
-PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: sdpMLineIndex})) fulfilled with undefined
-*** A valid sdpMid takes precedesce over a bad sdpMLineIndex
-PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid, sdpMLineIndex: badSdpMLineIndex})) fulfilled with undefined
-PASS End of test promise chain
+FAIL Error in promise chain: TypeError: undefined is not an object (evaluating 'pc.getTransceivers()[0].mid')
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt (212811 => 212812)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -4,14 +4,14 @@
 
 
 *** Remote description with audio offer set
-PASS pc.getSenders().length is 1
-PASS pc.getReceivers().length is 1
-PASS pc.getReceivers()[0].track.kind is 'audio'
-PASS pc.getTransceivers().length is 1
+FAIL pc.getSenders().length should be 1. Was 0.
+FAIL pc.getReceivers().length should be 1. Was 0.
+FAIL pc.getReceivers()[0].track.kind should be audio. Threw exception TypeError: undefined is not an object (evaluating 'pc.getReceivers()[0].track')
+FAIL pc.getTransceivers().length should be 1. Was 0.
 
 *** Check unused sender
 audioSender = pc.getSenders()[0]
-PASS audioSender.track is null
+FAIL audioSender.track should be null. Threw exception TypeError: undefined is not an object (evaluating 'audioSender.track')
 
 *** Adding a video track should not reuse audioSender (wrong kind)
 senderFromAddTrack = pc.addTrack(videoTrack, stream)
@@ -18,14 +18,14 @@
 PASS senderFromAddTrack is not audioSender
 
 *** An extra sender should have been added
-PASS pc.getSenders().length is 2
-PASS pc.getSenders().includes(audioSender) is true
+FAIL pc.getSenders().length should be 2. Was 1.
+FAIL pc.getSenders().includes(audioSender) should be true. Was false.
 PASS pc.getSenders().includes(senderFromAddTrack) is true
 
 *** Adding an audio track should reuse audioSender
 senderFromAddTrack = pc.addTrack(audioTrack, stream)
-PASS senderFromAddTrack is audioSender
-PASS audioSender.track is audioTrack
+FAIL senderFromAddTrack should be undefined (of type undefined). Was [object RTCRtpSender] (of type object).
+FAIL audioSender.track should be [object MediaStreamTrack]. Threw exception TypeError: undefined is not an object (evaluating 'audioSender.track')
 
 *** The number of senders should not have changed
 PASS pc.getSenders().length is 2

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt (212811 => 212812)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -3,26 +3,23 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS Local description set
-PASS End of test promise chain
 PASS Got candidate
 PASS event.candidate instanceof RTCIceCandidate is true
 PASS event.candidate.sdpMLineIndex is 0
-PASS event.candidate.sdpMid is pc.getTransceivers()[0].mid
-PASS event.candidate.candidate: candidate:1 1 UDP 2013266431 192.168.0.100 38838 typ host
-
+FAIL event.candidate.sdpMid should be null (of type object). Was 1 (of type string).
+PASS event.candidate.candidate: 2013266431 1 udp 2013266432 192.168.0.100 38838 typ host generation 0
+PASS Local description set
+PASS End of test promise chain
 PASS Got candidate
 PASS event.candidate instanceof RTCIceCandidate is true
 PASS event.candidate.sdpMLineIndex is 0
-PASS event.candidate.sdpMid is pc.getTransceivers()[0].mid
-PASS event.candidate.candidate: candidate:2 1 TCP 1019216383 192.168.0.100 9 typ host tcptype active
-
+FAIL event.candidate.sdpMid should be null (of type object). Was 1 (of type string).
+PASS event.candidate.candidate: 1019216383 1 tcp 1019216384 192.168.0.100 9 typ host tcptype passive generation 0
 PASS Got candidate
 PASS event.candidate instanceof RTCIceCandidate is true
 PASS event.candidate.sdpMLineIndex is 0
-PASS event.candidate.sdpMid is pc.getTransceivers()[0].mid
-PASS event.candidate.candidate: candidate:3 1 UDP 1677722111 172.18.0.1 47989 typ srflx raddr 192.168.0.100 rport 47989
-
+FAIL event.candidate.sdpMid should be null (of type object). Was 1 (of type string).
+PASS event.candidate.candidate: 1677722111 1 tcp 1677722112 172.18.0.1 47989 typ srflx raddr 192.168.0.100 rport 47989 generation 0
 PASS Got end of candidates
 PASS event.candidate is null
 PASS successfullyParsed is true

Modified: trunk/LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt (212811 => 212812)


--- trunk/LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -48,11 +48,6 @@
 Test applying a remote description offering a stream with two tracks
 Create remote offer
 Got remote offer, set it
-PASS Got 'addstream' event (before setRemoteDescription promise fulfilled)
-PASS remoteStream.getTracks().length is 2
-PASS pc.getRemoteStreams().length is 1
-PASS pc.getRemoteStreams()[0] is remoteStream
-PASS pc.getStreamById(remoteStream.id) is remoteStream
 Remote offer set
 PASS End of test promise chain
 

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (212811 => 212812)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,15 @@
+2017-02-21  Youenn Fablet  <youe...@gmail.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+        <rdar://problem/30401864>
+
+        Reviewed by Alex Christensen.
+
+        * web-platform-tests/webrtc/datachannel-emptystring-expected.txt:
+        * web-platform-tests/webrtc/no-media-call-expected.txt:
+        * web-platform-tests/webrtc/promises-call-expected.txt:
+
 2017-02-21  Romain Bellessort  <romain.belless...@crf.canon.fr>
 
         [Readable Streams API] Add ReadableStreamBYOBRequest view getter

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-emptystring-expected.txt (212811 => 212812)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-emptystring-expected.txt	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-emptystring-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,9 +1,5 @@
 
-Harness Error (TIMEOUT), message = null
-
-TIMEOUT Can send empty strings across a WebRTC data channel. Test timed out
+FAIL Can send empty strings across a WebRTC data channel. assert_unreached: Error TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription Reached unreachable code
 Messages exchanged
 
-Sent: [empty string]
-Sent: "done"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call-expected.txt (212811 => 212812)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call-expected.txt	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,7 +1,5 @@
 
-Harness Error (TIMEOUT), message = null
-
-TIMEOUT Can set up a basic WebRTC call with no data. Test timed out
+FAIL Can set up a basic WebRTC call with no data. assert_unreached: WebRTC called error callback for setRemoteDescription first Reached unreachable code
 iceConnectionState info
 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call-expected.txt (212811 => 212812)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call-expected.txt	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,7 +1,5 @@
 
-Harness Error (TIMEOUT), message = null
-
-TIMEOUT Can set up a basic WebRTC call with only data using promises. Test timed out
+FAIL Can set up a basic WebRTC call with only data using promises. assert_unreached: Error TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription happened at step Set remote description at second Reached unreachable code
 iceConnectionState info
 
 

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (212811 => 212812)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2017-02-22 07:59:59 UTC (rev 212812)
@@ -340,6 +340,15 @@
 webkit.org/b/160996 fast/mediastream/MediaStream-video-element-video-tracks-disabled.html [ ImageOnlyFailure ]
 webkit.org/b/161956 fast/mediastream/MediaStream-video-element-displays-buffer.html [ Failure ]
 
+# Test skipped in the main expectation file.
+fast/mediastream/RTCPeerConnection-AddRemoveStream.html [ Pass ]
+fast/mediastream/RTCPeerConnection-closed-state.html [ Pass ]
+fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html [ Pass ]
+fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html [ Pass ]
+fast/mediastream/RTCPeerConnection-onnegotiationneeded.html [ Pass ]
+fast/mediastream/RTCPeerConnection-overloaded-operations-params.html [ Pass ]
+fast/mediastream/RTCRtpSender-replaceTrack.html [ Pass ]
+
 # Proximity Events is not supported.
 webkit.org/b/99060 proximity [ Failure ]
 webkit.org/b/99060 proximity/event-after-navigation.html [ Timeout ]

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,21 @@
+Tests RTCPeerConnection [add|remove]Stream.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Got a stream.
+PASS pc.addStream(null) threw exception TypeError: Argument 1 ('stream') to RTCPeerConnection.addStream must be an instance of MediaStream.
+PASS pc.getLocalStreams().length is 0
+PASS Got another stream.
+PASS stream.id === stream2.id is false
+PASS onAddStream was called.
+PASS pc.getStreamById(stream.id) is stream
+PASS pc.getStreamById(stream2.id) is null
+PASS pc.getLocalStreams().length is 1
+PASS pc.getLocalStreams().length is 1
+PASS onRemoveStream was called.
+PASS pc.getLocalStreams().length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,34 @@
+Test behavior of RTCPeerConnection.addIceCandidate
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+*** A remote description is needed before a candidate can be added
+PASS pc.remoteDescription is null
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'foo', sdpMid: 0})) rejected with InvalidStateError (DOM Exception 11): No remote description set
+PASS Remote description set
+
+*** Define sdpMid, badSdpMid, sdpMLineIndex and badSdpMLineIndex for testing
+PASS sdpMLineIndex is not badSdpMLineIndex
+PASS sdpMid is not null
+PASS sdpMid is not badSdpMid
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid})) rejected with OperationError (DOM Exception 34): sdpMid did not match any media description
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: badSdpMLineIndex})) rejected with OperationError (DOM Exception 34): sdpMLineIndex is out of range
+*** A (bad) sdpMid takes precedesce over valid sdpMLineIndex
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: badSdpMid, sdpMLineIndex: sdpMLineIndex})) rejected with OperationError (DOM Exception 34): sdpMid did not match any media description
+*** Test bad candidate content with valid sdpMid
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'bad content', sdpMid: sdpMid})) rejected with OperationError (DOM Exception 34): Invalid candidate content
+*** Test bad candidate content with valid sdpMLineIndex
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: 'bad content', sdpMLineIndex: sdpMLineIndex})) rejected with OperationError (DOM Exception 34): Invalid candidate content
+
+*** Test some OK input
+PASS promise pc.addIceCandidate({candidate: validCandidate, sdpMid: sdpMid}) fulfilled with undefined
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMLineIndex: sdpMLineIndex})) fulfilled with undefined
+*** A valid sdpMid takes precedesce over a bad sdpMLineIndex
+PASS promise pc.addIceCandidate(new RTCIceCandidate({candidate: validCandidate, sdpMid: sdpMid, sdpMLineIndex: badSdpMLineIndex})) fulfilled with undefined
+PASS End of test promise chain
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,35 @@
+Test that RTCPeerConnection.addTrack reuses an unused sender of the same kind if present
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+*** Remote description with audio offer set
+PASS pc.getSenders().length is 1
+PASS pc.getReceivers().length is 1
+PASS pc.getReceivers()[0].track.kind is 'audio'
+PASS pc.getTransceivers().length is 1
+
+*** Check unused sender
+audioSender = pc.getSenders()[0]
+PASS audioSender.track is null
+
+*** Adding a video track should not reuse audioSender (wrong kind)
+senderFromAddTrack = pc.addTrack(videoTrack, stream)
+PASS senderFromAddTrack is not audioSender
+
+*** An extra sender should have been added
+PASS pc.getSenders().length is 2
+PASS pc.getSenders().includes(audioSender) is true
+PASS pc.getSenders().includes(senderFromAddTrack) is true
+
+*** Adding an audio track should reuse audioSender
+senderFromAddTrack = pc.addTrack(audioTrack, stream)
+PASS senderFromAddTrack is audioSender
+PASS audioSender.track is audioTrack
+
+*** The number of senders should not have changed
+PASS pc.getSenders().length is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,43 @@
+Test calling RTCPeerConnection functions/attributes in closed state
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception.
+PASS pc.signalingState is "stable"
+Get a sender before closing (to test removeTrack later)
+PASS sender = pc.addTrack(stream.getTracks()[0], stream) did not throw exception.
+
+Test promise-returning functions
+PASS createOffer rejected on closed state
+PASS createAnswer rejected on closed state
+PASS setLocalDescription rejected on closed state
+PASS setRemoteDescription rejected on closed state
+PASS addIceCandidate rejected on closed state
+PASS getStats rejected on closed state
+
+Test non-promise functions
+PASS pc.addTrack(stream.getTracks()[0], stream) threw exception InvalidStateError (DOM Exception 11): The object is in an invalid state..
+PASS pc.removeTrack(sender) threw exception InvalidStateError (DOM Exception 11): The object is in an invalid state..
+PASS pc.getSenders() did not throw exception.
+PASS pc.getReceivers() did not throw exception.
+PASS pc.getConfiguration() did not throw exception.
+PASS pc.setConfiguration({}) threw exception InvalidStateError (DOM Exception 11): The object is in an invalid state..
+PASS pc.createDataChannel("foo") threw exception InvalidStateError (DOM Exception 11): The object is in an invalid state..
+PASS pc.close() did not throw exception.
+
+Test attributes
+PASS pc.localDescription did not throw exception.
+PASS pc.currentLocalDescription did not throw exception.
+PASS pc.pendingLocalDescription did not throw exception.
+PASS pc.remoteDescription did not throw exception.
+PASS pc.currentRemoteDescription did not throw exception.
+PASS pc.pendingRemoteDescription did not throw exception.
+PASS pc.signalingState did not throw exception.
+PASS pc.iceGatheringState did not throw exception.
+PASS pc.iceConnectionState did not throw exception.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,31 @@
+Test RTCPeerConnection 'icecandidate' event and gathering done
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Local description set
+PASS End of test promise chain
+PASS Got candidate
+PASS event.candidate instanceof RTCIceCandidate is true
+PASS event.candidate.sdpMLineIndex is 0
+PASS event.candidate.sdpMid is pc.getTransceivers()[0].mid
+PASS event.candidate.candidate: candidate:1 1 UDP 2013266431 192.168.0.100 38838 typ host
+
+PASS Got candidate
+PASS event.candidate instanceof RTCIceCandidate is true
+PASS event.candidate.sdpMLineIndex is 0
+PASS event.candidate.sdpMid is pc.getTransceivers()[0].mid
+PASS event.candidate.candidate: candidate:2 1 TCP 1019216383 192.168.0.100 9 typ host tcptype active
+
+PASS Got candidate
+PASS event.candidate instanceof RTCIceCandidate is true
+PASS event.candidate.sdpMLineIndex is 0
+PASS event.candidate.sdpMid is pc.getTransceivers()[0].mid
+PASS event.candidate.candidate: candidate:3 1 UDP 1677722111 172.18.0.1 47989 typ srflx raddr 192.168.0.100 rport 47989
+
+PASS Got end of candidates
+PASS event.candidate is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,38 @@
+Test RTCPeerConnection 'iceconnectionstatechange' event
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Local description set
+PASS pc.getTransceivers().length is 3
+PASS pc.iceConnectionState is 'new'
+PASS End of test promise chain
+
+PASS Got icetransportstatechange event
+expectedState is "checking"
+PASS pc.iceConnectionState is expectedState
+
+PASS Got icetransportstatechange event
+expectedState is "connected"
+PASS pc.iceConnectionState is expectedState
+
+PASS Got icetransportstatechange event
+expectedState is "completed"
+PASS pc.iceConnectionState is expectedState
+
+PASS Got icetransportstatechange event
+expectedState is "failed"
+PASS pc.iceConnectionState is expectedState
+
+PASS Got icetransportstatechange event
+expectedState is "disconnected"
+PASS pc.iceConnectionState is expectedState
+
+PASS Got icetransportstatechange event
+expectedState is "new"
+PASS pc.iceConnectionState is expectedState
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,62 @@
+Test RTCPeerConnection's legacy MediaStream-based API
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Stream sets should be empty initially
+PASS pc.getLocalStreams().length is 0
+PASS pc.getRemoteStreams().length is 0
+
+Test with single track MediaStream
+audioTrack = stream.getAudioTracks()[0]
+PASS pc.addStream(stream) did not throw exception.
+PASS pc.getLocalStreams().length is 1
+PASS pc.getLocalStreams()[0] is stream
+PASS pc.getStreamById(stream.id) is stream
+PASS pc.getSenders().length is 1
+PASS pc.getSenders()[0].track is audioTrack
+Adding the same stream again should be a no-op
+PASS pc.addStream(stream) did not throw exception.
+PASS pc.getLocalStreams().length is 1
+
+Test with audio and video MediaStream
+audioTrack = stream.getAudioTracks()[0]
+videoTrack = stream.getVideoTracks()[0]
+PASS pc.addStream(stream) did not throw exception.
+PASS pc.getLocalStreams().length is 2
+PASS pc.getLocalStreams().includes(stream) is true
+PASS pc.getStreamById(stream.id) is stream
+PASS pc.getSenders().length is 3
+PASS audioTrackFoundAmongSenders is true
+PASS videoTrackFoundAmongSenders is true
+
+Test removeStream
+Remove a non-existent stream
+otherStream = stream.clone()
+PASS pc.removeStream(otherStream) did not throw exception.
+Both streams should still be present
+PASS pc.getLocalStreams().length is 2
+PASS pc.removeStream(stream) did not throw exception.
+PASS pc.getLocalStreams().length is 1
+PASS pc.getStreamById(stream.id) is null
+All senders should still be present
+PASS pc.getSenders().length is 3
+Removing the same stream again should be a no-op
+PASS pc.removeStream(stream) did not throw exception.
+PASS pc.getLocalStreams().length is 1
+
+Test applying a remote description offering a stream with two tracks
+Create remote offer
+Got remote offer, set it
+PASS Got 'addstream' event (before setRemoteDescription promise fulfilled)
+PASS remoteStream.getTracks().length is 2
+PASS pc.getRemoteStreams().length is 1
+PASS pc.getRemoteStreams()[0] is remoteStream
+PASS pc.getStreamById(remoteStream.id) is remoteStream
+Remote offer set
+PASS End of test promise chain
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,13 @@
+Tests RTCPeerConnection onnegotiationneeded.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Got a stream.
+PASS onNegotiationNeeded was called when a track was added.
+PASS onNegotiationNeeded2 was called when a track was removed.
+PASS onNegotiationNeeded3 was called when a track was added.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,110 @@
+Test various arguments to RTCPeerConnection overloaded functions
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS pc = new RTCPeerConnection({iceServers:[{urls:'stun:foo.com'}]}); did not throw exception.
+*** Test createOffer
+PASS promise pc.createOffer() did not reject with TypeError.
+PASS promise pc.createOffer(emptyFunc, emptyFunc) did not reject with TypeError.
+PASS promise pc.createOffer(null) did not reject with TypeError.
+PASS promise pc.createOffer(undefined) did not reject with TypeError.
+PASS promise pc.createOffer({}) did not reject with TypeError.
+PASS promise pc.createOffer(emptyFunc, emptyFunc, null) did not reject with TypeError.
+PASS promise pc.createOffer(emptyFunc, emptyFunc, undefined) did not reject with TypeError.
+PASS promise pc.createOffer(emptyFunc, emptyFunc, {}) did not reject with TypeError.
+*** Options object must be last
+PASS promise pc.createOffer({}, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
+*** Callbacks are not nullable
+PASS promise pc.createOffer(emptyFunc, null) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createOffer must be a function
+PASS promise pc.createOffer(null, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
+PASS promise pc.createOffer(null, null) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
+*** Bad input
+PASS promise pc.createOffer({}, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createOffer must be a function
+PASS promise pc.createOffer(emptyFunc, {}) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createOffer must be a function
+PASS promise pc.createOffer(1) rejected with TypeError: Argument 1 ('options') to RTCPeerConnection.createOffer must be a dictionary
+PASS promise pc.createOffer(emptyFunc, emptyFunc, 1) rejected with TypeError: Argument 3 ('options') to RTCPeerConnection.createOffer must be a dictionary
+
+*** Test createAnswer
+PASS promise pc.createAnswer() did not reject with TypeError.
+PASS promise pc.createAnswer(emptyFunc, emptyFunc) did not reject with TypeError.
+PASS promise pc.createAnswer(null) did not reject with TypeError.
+PASS promise pc.createAnswer(undefined) did not reject with TypeError.
+PASS promise pc.createAnswer({}) did not reject with TypeError.
+PASS promise pc.createAnswer(emptyFunc, emptyFunc, null) did not reject with TypeError.
+PASS promise pc.createAnswer(emptyFunc, emptyFunc, undefined) did not reject with TypeError.
+PASS promise pc.createAnswer(emptyFunc, emptyFunc, {}) did not reject with TypeError.
+*** Options object must be last
+PASS promise pc.createAnswer({}, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
+*** Callbacks are not nullable
+PASS promise pc.createAnswer(emptyFunc, null) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createAnswer must be a function
+PASS promise pc.createAnswer(null, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
+PASS promise pc.createAnswer(null, null) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
+*** Bad input
+PASS promise pc.createAnswer({}, emptyFunc) rejected with TypeError: Argument 1 ('successCallback') to RTCPeerConnection.createAnswer must be a function
+PASS promise pc.createAnswer(emptyFunc, {}) rejected with TypeError: Argument 2 ('errorCallback') to RTCPeerConnection.createAnswer must be a function
+PASS promise pc.createAnswer(1) rejected with TypeError: Argument 1 ('options') to RTCPeerConnection.createAnswer must be a dictionary
+PASS promise pc.createAnswer(emptyFunc, emptyFunc, 1) rejected with TypeError: Argument 3 ('options') to RTCPeerConnection.createAnswer must be a dictionary
+
+*** Test setLocalDescription
+PASS promise pc.setLocalDescription(desc) did not reject with TypeError.
+PASS promise pc.setLocalDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
+*** desc is not optional
+PASS promise pc.setLocalDescription() rejected with TypeError: Not enough arguments
+*** desc is not nullable
+PASS promise pc.setLocalDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
+PASS promise pc.setLocalDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
+PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
+*** Bad input as desc
+PASS promise pc.setLocalDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
+PASS promise pc.setLocalDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
+PASS promise pc.setLocalDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
+PASS promise pc.setLocalDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setLocalDescription must be an instance of RTCSessionDescription
+
+*** Test setRemoteDescription
+PASS promise pc.setRemoteDescription(desc) did not reject with TypeError.
+PASS promise pc.setRemoteDescription(desc, emptyFunc, emptyFunc) did not reject with TypeError.
+*** desc is not optional
+PASS promise pc.setRemoteDescription() rejected with TypeError: Not enough arguments
+*** desc is not nullable
+PASS promise pc.setRemoteDescription(null) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
+PASS promise pc.setRemoteDescription(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
+PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
+*** Bad input as desc
+PASS promise pc.setRemoteDescription('foo') rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
+PASS promise pc.setRemoteDescription('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
+PASS promise pc.setRemoteDescription(1) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
+PASS promise pc.setRemoteDescription(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('description') to RTCPeerConnection.setRemoteDescription must be an instance of RTCSessionDescription
+
+*** Test addIceCandidate
+PASS promise pc.addIceCandidate(candidate) did not reject with TypeError.
+PASS promise pc.addIceCandidate(candidate, emptyFunc, emptyFunc) did not reject with TypeError.
+*** candidate is not optional
+PASS promise pc.addIceCandidate() rejected with TypeError: Not enough arguments
+*** candidate is not nullable
+PASS promise pc.addIceCandidate(null) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
+PASS promise pc.addIceCandidate(null, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
+PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
+*** Bad input as candidate
+PASS promise pc.addIceCandidate('foo') rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
+PASS promise pc.addIceCandidate('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
+PASS promise pc.addIceCandidate(1) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
+PASS promise pc.addIceCandidate(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('candidate') to RTCPeerConnection.addIceCandidate must be an instance of RTCIceCandidate
+
+*** Test getStats
+PASS promise pc.getStats() did not reject with TypeError.
+PASS promise pc.getStats(null) did not reject with TypeError.
+PASS promise pc.getStats(selector) did not reject with TypeError.
+PASS promise pc.getStats(null, emptyFunc, emptyFunc) did not reject with TypeError.
+PASS promise pc.getStats(selector, emptyFunc, emptyFunc) did not reject with TypeError.
+PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
+*** Bad input as selector
+PASS promise pc.getStats('foo') rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
+PASS promise pc.getStats('foo', emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
+PASS promise pc.getStats(1) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
+PASS promise pc.getStats(1, emptyFunc, emptyFunc) rejected with TypeError: Argument 1 ('selector') to RTCPeerConnection.getStats must be an instance of MediaStreamTrack
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,32 @@
+Test basic behavior of RTCRtpSender.replaceTrack()
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS pc.getSenders().length is 0
+PASS sender = pc.addTrack(audioTrack, stream) did not throw exception.
+PASS sender is an instance of RTCRtpSender
+PASS sender.track is audioTrack
+PASS promise sender.replaceTrack() rejected with TypeError: Not enough arguments
+PASS promise sender.replaceTrack(null) rejected with TypeError: Argument 1 ('withTrack') to RTCRtpSender.replaceTrack must be an instance of MediaStreamTrack
+PASS promise sender.replaceTrack({}) rejected with TypeError: Argument 1 ('withTrack') to RTCRtpSender.replaceTrack must be an instance of MediaStreamTrack
+Test mismatching track kind
+PASS promise sender.replaceTrack(videoTrack) rejected with TypeError: Type error
+PASS promise sender.replaceTrack(audioTrack2) fulfilled with undefined
+PASS Track successfully replaced
+PASS sender.track is audioTrack2
+Sender should still use old track (audioTrack) id in negotiation.
+PASS offer created
+PASS offer.sdp.indexOf(audioTrack.id) is not -1
+PASS offer.sdp.indexOf(audioTrack2.id) is -1
+Stop sender, and try replacing the track
+PASS promise sender.replaceTrack(audioTrack2) rejected with InvalidStateError (DOM Exception 11): The object is in an invalid state.
+Create a new sender
+PASS sender = pc.addTrack(audioTrack2, stream) did not throw exception.
+Close pc and try replacing the track
+PASS promise sender.replaceTrack(audioTrack3) rejected with InvalidStateError (DOM Exception 11): The object is in an invalid state.
+End of promise chain
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/gtk/fast/mediastream/no-media-call-expected.txt (0 => 212812)


--- trunk/LayoutTests/platform/gtk/fast/mediastream/no-media-call-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/mediastream/no-media-call-expected.txt	2017-02-22 07:59:59 UTC (rev 212812)
@@ -0,0 +1,5 @@
+
+FAIL Can set up a basic WebRTC call with no data. assert_unreached: WebRTC called error callback for setRemoteDescription first Reached unreachable code
+iceConnectionState info
+
+

Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (212811 => 212812)


--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1915,3 +1915,5 @@
 webkit.org/b/166025 http/tests/fetch/fetching-same-resource-with-diffferent-options.html [ Pass Failure ]
 
 webkit.org/b/167258 media/modern-media-controls/audio/audio-controls-metrics.html [ Skip ]
+
+imported/w3c/web-platform-tests/webrtc [ Skip ]

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (212811 => 212812)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2017-02-22 07:59:59 UTC (rev 212812)
@@ -94,6 +94,9 @@
 http/tests/media/media-stream
 http/tests/ssl/media-stream
 
+# Skip WebRTC for now in WK1
+imported/w3c/web-platform-tests/webrtc [ Skip ]
+
 # These tests test the Shadow DOM based HTML form validation UI but Mac WK1 is using native dialogs instead.
 fast/forms/validation-message-on-listbox.html
 fast/forms/validation-message-on-menulist.html

Modified: trunk/Source/_javascript_Core/ChangeLog (212811 => 212812)


--- trunk/Source/_javascript_Core/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,13 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+        <rdar://problem/30401864>
+
+        Reviewed by Alex Christensen.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-02-21  Saam Barati  <sbar...@apple.com>
 
         Add the Briggs optimistic allocator to run on ARM64

Modified: trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig (212811 => 212812)


--- trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -163,7 +163,15 @@
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
-ENABLE_WEB_RTC = ENABLE_WEB_RTC;
+
+ENABLE_WEB_RTC = ;
+ENABLE_WEB_RTC[sdk=macosx*] = $(ENABLE_WEB_RTC_macosx);
+ENABLE_WEB_RTC_macosx = ;
+ENABLE_WEB_RTC_macosx[arch=x86_64] = $(ENABLE_WEB_RTC_macosx_$(CONFIGURATION));
+ENABLE_WEB_RTC_macosx_Production = ;
+ENABLE_WEB_RTC_macosx_Debug = ENABLE_WEB_RTC;
+ENABLE_WEB_RTC_macosx_Release = ENABLE_WEB_RTC;
+
 ENABLE_WRITABLE_STREAM_API = ENABLE_WRITABLE_STREAM_API;
 
 ENABLE_TELEPHONE_NUMBER_DETECTION = ENABLE_TELEPHONE_NUMBER_DETECTION;

Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (212811 => 212812)


--- trunk/Source/ThirdParty/libwebrtc/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,17 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+        <rdar://problem/30401864>
+
+        Reviewed by Alex Christensen.
+
+        Doing some clean-up.
+
+        * Configurations/libwebrtc.xcconfig:
+        * Source/webrtc/base/checks.h:
+        * libwebrtc.xcodeproj/project.pbxproj:
+
 2017-02-21  Alex Christensen  <achristen...@webkit.org>
 
         Don't build libwebrtc on 32-bit architectures

Modified: trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig (212811 => 212812)


--- trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -8,7 +8,6 @@
 ENABLE_STRICT_OBJC_MSGSEND = YES;
 HEADER_SEARCH_PATHS = Source Source/third_party/jsoncpp/source/include Source/third_party/libsrtp/crypto/include Source/third_party/libsrtp/include Source/third_party/boringssl/src/include Source/third_party/libyuv/include Source/third_party/usrsctp/usrsctplib Source/third_party/usrsctp/usrsctplib/usrsctplib Source/webrtc/sdk/objc/Framework/Headers Source/webrtc/common_audio/signal_processing/include Source/webrtc/modules/audio_coding/codecs/isac/main/include Source/third_party/opus/src/celt Source/third_party/opus/src/include Source/third_party/opus/src/src Source/webrtc/modules/audio_device/mac Source/third_party/usrsctp/usrsctplib/usrsctplib/netinet Source/webrtc/modules/audio_device/ios;
 
-INSTALL_PATH = /usr/local/lib;
 PUBLIC_HEADERS_FOLDER_PATH = /usr/local/include/libwebrtc;
 USE_HEADERMAP = NO;
 INSTALLHDRS_SCRIPT_PHASE = YES;
@@ -22,4 +21,4 @@
 
 EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = *_sse.cc *_sse2.cc macutils.cc macwindowpicker.cc audio_device_mac.cc audio_mixer_manager_mac.cc;
 EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*] = macutils.cc macwindowpicker.cc audio_device_mac.cc audio_mixer_manager_mac.cc;
-EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = audio_device_ios.mm voice_processing_audio_unit.mm audio_device_not_implemented_ios.mm RTCAudioSessionConfiguration.m RTCAudioSessionDelegateAdapter.mm RTCAudioSession.mm RTCAudioSession+Configuration.mm RTCUIApplication.mm;
+EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = voice_processing_audio_unit.mm;

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/checks.h (212811 => 212812)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/checks.h	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/base/checks.h	2017-02-22 07:59:59 UTC (rev 212812)
@@ -211,7 +211,7 @@
 #endif
 
 // This is identical to LogMessageVoidify but in name.
-class WEBRTC_EXPORT FatalMessageVoidify {
+class FatalMessageVoidify {
  public:
   FatalMessageVoidify() { }
   // This has to be an operator with a precedence lower than << but

Modified: trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj (212811 => 212812)


--- trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj	2017-02-22 07:59:59 UTC (rev 212812)
@@ -2413,7 +2413,6 @@
 		5CFD53801E4BA4F500482908 /* audio_session_observer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CFD53791E4BA4F500482908 /* audio_session_observer.h */; };
 		5CFD53811E4BA4F500482908 /* voice_processing_audio_unit.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CFD537A1E4BA4F500482908 /* voice_processing_audio_unit.h */; };
 		5CFD53821E4BA4F500482908 /* voice_processing_audio_unit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CFD537B1E4BA4F500482908 /* voice_processing_audio_unit.mm */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
-		5CFD53841E4BBD8D00482908 /* audio_device_not_implemented_ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CFD53831E4BBD8D00482908 /* audio_device_not_implemented_ios.mm */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; };
 		5CFD538D1E4BD3A300482908 /* compare_neon.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5CFD53851E4BD3A300482908 /* compare_neon.cc */; };
 		5CFD538E1E4BD3A300482908 /* compare_neon64.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5CFD53861E4BD3A300482908 /* compare_neon64.cc */; };
 		5CFD538F1E4BD3A300482908 /* rotate_neon.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5CFD53871E4BD3A300482908 /* rotate_neon.cc */; };
@@ -11023,7 +11022,6 @@
 				5C11A01D1E457578004F0987 /* audio_device_dummy.cc in Sources */,
 				5C119FFE1E457400004F0987 /* audio_device_generic.cc in Sources */,
 				5C11A00B1E457448004F0987 /* audio_device_mac.cc in Sources */,
-				5CFD53841E4BBD8D00482908 /* audio_device_not_implemented_ios.mm in Sources */,
 				5CDD84171E439B2900621E92 /* audio_encoder.cc in Sources */,
 				5CDD8CA71E43C6F700621E92 /* audio_encoder_cng.cc in Sources */,
 				5CDD8FF31E43CDF400621E92 /* audio_encoder_copy_red.cc in Sources */,

Modified: trunk/Source/WTF/ChangeLog (212811 => 212812)


--- trunk/Source/WTF/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WTF/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,12 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+
+        Reviewed by Alex Christensen.
+
+        * wtf/Platform.h:
+
 2017-02-20  Filip Pizlo  <fpi...@apple.com>
 
         The collector thread should only start when the mutator doesn't have heap access

Modified: trunk/Source/WTF/wtf/Platform.h (212811 => 212812)


--- trunk/Source/WTF/wtf/Platform.h	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WTF/wtf/Platform.h	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1213,4 +1213,8 @@
 #define HAVE_CORE_PREDICTION 1
 #endif
 
+#if PLATFORM(MAC) && ENABLE(WEB_RTC)
+#define USE_LIBWEBRTC 1
+#endif
+
 #endif /* WTF_Platform_h */

Modified: trunk/Source/WebCore/ChangeLog (212811 => 212812)


--- trunk/Source/WebCore/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebCore/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,14 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+
+        Reviewed by Alex Christensen.
+
+        * Configurations/WebCore.xcconfig:
+        * Configurations/WebCoreTestSupport.xcconfig:
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-02-21  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Fix WinCairo build after r212703.

Modified: trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig (212811 => 212812)


--- trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -163,7 +163,15 @@
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
-ENABLE_WEB_RTC = ENABLE_WEB_RTC;
+
+ENABLE_WEB_RTC = ;
+ENABLE_WEB_RTC[sdk=macosx*] = $(ENABLE_WEB_RTC_macosx);
+ENABLE_WEB_RTC_macosx = ;
+ENABLE_WEB_RTC_macosx[arch=x86_64] = $(ENABLE_WEB_RTC_macosx_$(CONFIGURATION));
+ENABLE_WEB_RTC_macosx_Production = ;
+ENABLE_WEB_RTC_macosx_Debug = ENABLE_WEB_RTC;
+ENABLE_WEB_RTC_macosx_Release = ENABLE_WEB_RTC;
+
 ENABLE_WRITABLE_STREAM_API = ENABLE_WRITABLE_STREAM_API;
 
 ENABLE_TELEPHONE_NUMBER_DETECTION = ENABLE_TELEPHONE_NUMBER_DETECTION;

Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (212811 => 212812)


--- trunk/Source/WebCore/Configurations/WebCore.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -66,12 +66,16 @@
 WK_IOS_BINCOMPAT_LDFLAGS_V9_3 = $(WK_IOS_BINCOMPAT_LDFLAGS_V9_0);
 WK_IOS_BINCOMPAT_LDFLAGS_V10_0 = $(WK_IOS_BINCOMPAT_LDFLAGS_V9_3);
 
+LIBWEBRTC_LDFLAGS = $(LIBWEBRTC_LDFLAGS_$(ENABLE_WEB_RTC));
+LIBWEBRTC_LDFLAGS_ = ;
+LIBWEBRTC_LDFLAGS_ENABLE_WEB_RTC = -framework VideoToolbox -framework CoreMedia -weak-lwebrtc;
+
 OTHER_LDFLAGS = $(inherited) $(OTHER_LDFLAGS_PLATFORM)
 OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE;
 OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework OpenGLES -lMobileGestalt $(WK_IOS_BINCOMPAT_LDFLAGS);
-OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices;
-OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios);
-OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebCoreTestSupport -allowable_client WebKit2 -allowable_client WebKitLegacy -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework DataDetectorsCore -framework IOSurface -framework OpenGL -framework SystemConfiguration;
+OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices $(LIBWEBRTC_LDFLAGS);
+OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios) $(LIBWEBRTC_LDFLAGS);
+OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebCoreTestSupport -allowable_client WebKit2 -allowable_client WebKitLegacy -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework DataDetectorsCore -framework IOSurface -framework OpenGL -framework SystemConfiguration $(LIBWEBRTC_LDFLAGS);
 
 SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
 SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebCore.order;

Modified: trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig (212811 => 212812)


--- trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -44,12 +44,17 @@
 DYLIB_INSTALL_NAME_BASE_Debug = @rpath;
 DYLIB_INSTALL_NAME_BASE_Release = $(DYLIB_INSTALL_NAME_BASE_Debug);
 
+LIBWEBRTC_LDFLAGS = $(LIBWEBRTC_LDFLAGS_$(ENABLE_WEB_RTC));
+LIBWEBRTC_LDFLAGS_ = ;
+LIBWEBRTC_LDFLAGS_ENABLE_WEB_RTC = -weak-lwebrtc;
+
 PRODUCT_NAME = WebCoreTestSupport;
 EXECUTABLE_PREFIX = lib;
 EXPORTED_SYMBOLS_FILE = ;
 GCC_SYMBOLS_PRIVATE_EXTERN = YES;
 OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS);
-OTHER_LDFLAGS[sdk=macos*] = $(ASAN_OTHER_LDFLAGS) -framework AppKit;
-OTHER_LDFLAGS[sdk=iphoneos*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy;
-OTHER_LDFLAGS[sdk=iphonesimulator*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy;
+OTHER_LDFLAGS[sdk=macos*] = $(ASAN_OTHER_LDFLAGS) -framework AppKit $(LIBWEBRTC_LDFLAGS);
+
+OTHER_LDFLAGS[sdk=iphoneos*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy $(LIBWEBRTC_LDFLAGS);
+OTHER_LDFLAGS[sdk=iphonesimulator*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy $(LIBWEBRTC_LDFLAGS);
 SECT_ORDER_FLAGS = ;

Modified: trunk/Source/WebCore/PAL/ChangeLog (212811 => 212812)


--- trunk/Source/WebCore/PAL/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebCore/PAL/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,12 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+
+        Reviewed by Alex Christensen.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-02-20  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT

Modified: trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig (212811 => 212812)


--- trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -163,7 +163,15 @@
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
-ENABLE_WEB_RTC = ENABLE_WEB_RTC;
+
+ENABLE_WEB_RTC = ;
+ENABLE_WEB_RTC[sdk=macosx*] = $(ENABLE_WEB_RTC_macosx);
+ENABLE_WEB_RTC_macosx = ;
+ENABLE_WEB_RTC_macosx[arch=x86_64] = $(ENABLE_WEB_RTC_macosx_$(CONFIGURATION));
+ENABLE_WEB_RTC_macosx_Production = ;
+ENABLE_WEB_RTC_macosx_Debug = ENABLE_WEB_RTC;
+ENABLE_WEB_RTC_macosx_Release = ENABLE_WEB_RTC;
+
 ENABLE_WRITABLE_STREAM_API = ENABLE_WRITABLE_STREAM_API;
 
 ENABLE_TELEPHONE_NUMBER_DETECTION = ENABLE_TELEPHONE_NUMBER_DETECTION;

Modified: trunk/Source/WebKit/mac/ChangeLog (212811 => 212812)


--- trunk/Source/WebKit/mac/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,13 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+        <rdar://problem/30401864>
+
+        Reviewed by Alex Christensen.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2017-02-21  Aakash Jain  <aakash_j...@apple.com>
 
         Export various NSString symbols from WebFramePrivate.h

Modified: trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig (212811 => 212812)


--- trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -163,7 +163,15 @@
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
-ENABLE_WEB_RTC = ENABLE_WEB_RTC;
+
+ENABLE_WEB_RTC = ;
+ENABLE_WEB_RTC[sdk=macosx*] = $(ENABLE_WEB_RTC_macosx);
+ENABLE_WEB_RTC_macosx = ;
+ENABLE_WEB_RTC_macosx[arch=x86_64] = $(ENABLE_WEB_RTC_macosx_$(CONFIGURATION));
+ENABLE_WEB_RTC_macosx_Production = ;
+ENABLE_WEB_RTC_macosx_Debug = ENABLE_WEB_RTC;
+ENABLE_WEB_RTC_macosx_Release = ENABLE_WEB_RTC;
+
 ENABLE_WRITABLE_STREAM_API = ENABLE_WRITABLE_STREAM_API;
 
 ENABLE_TELEPHONE_NUMBER_DETECTION = ENABLE_TELEPHONE_NUMBER_DETECTION;

Modified: trunk/Source/WebKit2/ChangeLog (212811 => 212812)


--- trunk/Source/WebKit2/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,19 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+        <rdar://problem/30401864>
+
+        Reviewed by Alex Christensen.
+
+        Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
+
+        * Configurations/WebKit.xcconfig:
+        * Configurations/FeatureDefines.xcconfig:
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/WebPreferences.cpp:
+        (WebKit::checkWebRTCAvailability):
+
 2017-02-21  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r212786.

Modified: trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig (212811 => 212812)


--- trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -163,7 +163,15 @@
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
-ENABLE_WEB_RTC = ENABLE_WEB_RTC;
+
+ENABLE_WEB_RTC = ;
+ENABLE_WEB_RTC[sdk=macosx*] = $(ENABLE_WEB_RTC_macosx);
+ENABLE_WEB_RTC_macosx = ;
+ENABLE_WEB_RTC_macosx[arch=x86_64] = $(ENABLE_WEB_RTC_macosx_$(CONFIGURATION));
+ENABLE_WEB_RTC_macosx_Production = ;
+ENABLE_WEB_RTC_macosx_Debug = ENABLE_WEB_RTC;
+ENABLE_WEB_RTC_macosx_Release = ENABLE_WEB_RTC;
+
 ENABLE_WRITABLE_STREAM_API = ENABLE_WRITABLE_STREAM_API;
 
 ENABLE_TELEPHONE_NUMBER_DETECTION = ENABLE_TELEPHONE_NUMBER_DETECTION;

Modified: trunk/Source/WebKit2/Configurations/WebKit.xcconfig (212811 => 212812)


--- trunk/Source/WebKit2/Configurations/WebKit.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebKit2/Configurations/WebKit.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -46,10 +46,14 @@
 // Prevent C++ standard library operator new, delete and their related exception types from being exported as weak symbols.
 UNEXPORTED_SYMBOL_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZTISt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTISt9exception -Wl,-unexported_symbol -Wl,__ZTSSt9bad_alloc -Wl,-unexported_symbol -Wl,__ZTSSt9exception -Wl,-unexported_symbol -Wl,__ZdlPvS_ -Wl,-unexported_symbol -Wl,__ZnwmPv -Wl,-unexported_symbol -Wl,__Znwm -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2EOS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1EOS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSEDn -Wl,-unexported_symbol, -Wl,__ZNKSt3__18functionIFvN7WebCore12PolicyActionEEEclES2_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEE4swapERS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC1ERKS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEC2ERKS4_ -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore
 12PolicyActionEEED1Ev -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEED2Ev -Wl,-unexported_symbol, -Wl,__ZNSt3__18functionIFvN7WebCore12PolicyActionEEEaSERKS4_ -Wl,-unexported_symbol, -Wl,__ZTVNSt3__117bad_function_callE;
 
+LIBWEBRTC_LDFLAGS = $(LIBWEBRTC_LDFLAGS_$(ENABLE_WEB_RTC));
+LIBWEBRTC_LDFLAGS_ = ;
+LIBWEBRTC_LDFLAGS_ENABLE_WEB_RTC = -weak-lwebrtc;
+
 OTHER_LDFLAGS = $(inherited) $(UNEXPORTED_SYMBOL_LDFLAGS) $(ASAN_OTHER_LDFLAGS) $(FRAMEWORK_AND_LIBRARY_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM) -framework WebKitLegacy -sub_umbrella WebKitLegacy;
-OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -sub_umbrella WebCore;
-OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = -lAccessibility;
-OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = -lAccessibility;
+OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = -sub_umbrella WebCore $(LIBWEBRTC_LDFLAGS);
+OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = -lAccessibility $(LIBWEBRTC_LDFLAGS);
+OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = -lAccessibility $(LIBWEBRTC_LDFLAGS);
 
 SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
 SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebKit.order;

Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (212811 => 212812)


--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h	2017-02-22 07:59:59 UTC (rev 212812)
@@ -306,6 +306,11 @@
 //   DEFAULT_EXPERIMENTAL_FEATURE_ENABLED (for features that are ready for
 //   wider testing).
 
+// Disable webrtc feature if libwebrtc library is not present
+namespace WebKit {
+bool checkWebRTCAvailability();
+}
+
 #define FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(macro) \
     macro(SpringTimingFunctionEnabled, springTimingFunctionEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "CSS Spring Animations", "CSS Spring Animation prototype") \
     macro(GamepadsEnabled, gamepadsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Gamepads", "Web Gamepad API support") \
@@ -312,7 +317,7 @@
     macro(LinkPreloadEnabled, linkPreloadEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Link Preload", "Link preload support") \
     macro(ModernMediaControlsEnabled, modernMediaControlsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Modern Media Controls", "Use modern media controls look") \
     macro(InputEventsEnabled, inputEventsEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "Input Events", "Enable InputEvents support") \
-    macro(PeerConnectionEnabled, peerConnectionEnabled, Bool, bool, false, "WebRTC", "Enable WebRTC API") \
+    macro(PeerConnectionEnabled, peerConnectionEnabled, Bool, bool, checkWebRTCAvailability(), "WebRTC", "Enable WebRTC API") \
     macro(SubtleCryptoEnabled, subtleCryptoEnabled, Bool, bool, DEFAULT_EXPERIMENTAL_FEATURES_ENABLED, "SubtleCrypto", "Enable SubtleCrypto support") \
     macro(UserTimingEnabled, userTimingEnabled, Bool, bool, false, "User Timing", "Enable UserTiming API") \
     macro(WebAnimationsEnabled, webAnimationsEnabled, Bool, bool, false, "Web Animations", "Web Animations prototype") \

Modified: trunk/Source/WebKit2/UIProcess/WebPreferences.cpp (212811 => 212812)


--- trunk/Source/WebKit2/UIProcess/WebPreferences.cpp	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Source/WebKit2/UIProcess/WebPreferences.cpp	2017-02-22 07:59:59 UTC (rev 212812)
@@ -29,6 +29,7 @@
 #include "WebPageGroup.h"
 #include "WebPreferencesKeys.h"
 #include "WebProcessPool.h"
+#include <dlfcn.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/ThreadingPrimitives.h>
 
@@ -195,6 +196,19 @@
 
 #undef DEFINE_PREFERENCE_GETTER_AND_SETTERS
 
+bool checkWebRTCAvailability()
+{
+#if USE(LIBWEBRTC)
+    void* libwebrtcLibrary = dlopen("libwebrtc.dylib", RTLD_NOW);
+    if (!libwebrtcLibrary)
+        return false;
+    dlclose(libwebrtcLibrary);
+    return true;
+#else
+    return true;
+#endif
+}
+
 #define DEFINE_EXPERIMENTAL_PREFERENCE_GETTER_AND_SETTERS(KeyUpper, KeyLower, TypeName, Type, DefaultValue, HumanReadableName, HumanReadableDescription) \
     void WebPreferences::set##KeyUpper(const Type& value) \
     { \

Modified: trunk/Tools/ChangeLog (212811 => 212812)


--- trunk/Tools/ChangeLog	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Tools/ChangeLog	2017-02-22 07:59:59 UTC (rev 212812)
@@ -1,3 +1,19 @@
+2017-02-21  Youenn Fablet  <you...@apple.com>
+
+        [WebRTC][Mac] Activate libwebrtc
+        https://bugs.webkit.org/show_bug.cgi?id=167293
+        <rdar://problem/30401864>
+
+        Reviewed by Alex Christensen.
+
+        Fixing paths to allow loading libwebrtc.dylib successfully.
+
+        * Scripts/build-webkit:
+        * Scripts/webkitdirs.pm:
+        (setupMacWebKitEnvironment):
+        (setupIOSWebKitEnvironment):
+        * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
+
 2017-02-21  Saam Barati  <sbar...@apple.com>
 
         Add the Briggs optimistic allocator to run on ARM64

Modified: trunk/Tools/Scripts/build-webkit (212811 => 212812)


--- trunk/Tools/Scripts/build-webkit	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Tools/Scripts/build-webkit	2017-02-22 07:59:59 UTC (rev 212812)
@@ -63,6 +63,7 @@
 my $coverageSupport = 0;
 my $shouldRunStaticAnalyzer = 0;
 my $startTime = time();
+my $archsi386 = 0;
 
 my @features = getFeatureOptionList();
 
@@ -73,6 +74,8 @@
 foreach (@ARGV) {
     if ($_ eq '--minimal') {
         $minimal = 1;
+    } elsif ($_ eq 'ARCHS=i386') {
+        $archsi386 = 1;
     }
 }
 
@@ -184,6 +187,9 @@
 
     # ANGLE and libwebrtc must come before WebCore
     splice @projects, 0, 0, ("Source/ThirdParty/ANGLE");
+    if (portName() eq Mac and not architecture() eq "i386" and not $archsi386) {
+        splice @projects, 0, 0, ("Source/ThirdParty/libwebrtc");
+    }
 
     push @projects, ("Source/WebKit2");
 

Modified: trunk/Tools/Scripts/webkitdirs.pm (212811 => 212812)


--- trunk/Tools/Scripts/webkitdirs.pm	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Tools/Scripts/webkitdirs.pm	2017-02-22 07:59:59 UTC (rev 212812)
@@ -2137,6 +2137,8 @@
 
     prependToEnvironmentVariableList("DYLD_FRAMEWORK_PATH", $dyldFrameworkPath);
     prependToEnvironmentVariableList("__XPC_DYLD_FRAMEWORK_PATH", $dyldFrameworkPath);
+    prependToEnvironmentVariableList("DYLD_LIBRARY_PATH", $dyldFrameworkPath);
+    prependToEnvironmentVariableList("__XPC_DYLD_LIBRARY_PATH", $dyldFrameworkPath);
     $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
 
     setUpGuardMallocIfNeeded();

Modified: trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig (212811 => 212812)


--- trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig	2017-02-22 07:54:37 UTC (rev 212811)
+++ trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig	2017-02-22 07:59:59 UTC (rev 212812)
@@ -163,7 +163,15 @@
 ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 ENABLE_SUBTLE_CRYPTO = ENABLE_SUBTLE_CRYPTO;
 ENABLE_SVG_FONTS = ENABLE_SVG_FONTS;
-ENABLE_WEB_RTC = ENABLE_WEB_RTC;
+
+ENABLE_WEB_RTC = ;
+ENABLE_WEB_RTC[sdk=macosx*] = $(ENABLE_WEB_RTC_macosx);
+ENABLE_WEB_RTC_macosx = ;
+ENABLE_WEB_RTC_macosx[arch=x86_64] = $(ENABLE_WEB_RTC_macosx_$(CONFIGURATION));
+ENABLE_WEB_RTC_macosx_Production = ;
+ENABLE_WEB_RTC_macosx_Debug = ENABLE_WEB_RTC;
+ENABLE_WEB_RTC_macosx_Release = ENABLE_WEB_RTC;
+
 ENABLE_WRITABLE_STREAM_API = ENABLE_WRITABLE_STREAM_API;
 
 ENABLE_TELEPHONE_NUMBER_DETECTION = ENABLE_TELEPHONE_NUMBER_DETECTION;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to