[WebRTC][Mac] Activate libwebrtc
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2017 07:59:59 +0000 (07:59 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Feb 2017 07:59:59 +0000 (07:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=167293
LayoutTests/imported/w3c:

<rdar://problem/30401864>

Patch by Youenn Fablet <youennf@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/JavaScriptCore:

<rdar://problem/30401864>

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

* Configurations/FeatureDefines.xcconfig:

Source/ThirdParty/libwebrtc:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@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 <youenn@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 <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

<rdar://problem/30401864>

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

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@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 <youenn@apple.com> on 2017-02-21
Reviewed by Alex Christensen.

* wtf/Platform.h:

Tools:

<rdar://problem/30401864>

Patch by Youenn Fablet <youenn@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 <youenn@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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212812 268f45cc-cd09-0410-ab3c-d52691b4dbfc

49 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt
LayoutTests/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/webrtc/datachannel-emptystring-expected.txt
LayoutTests/imported/w3c/web-platform-tests/webrtc/no-media-call-expected.txt
LayoutTests/imported/w3c/web-platform-tests/webrtc/promises-call-expected.txt
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/fast/mediastream/no-media-call-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk2/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/ThirdParty/libwebrtc/ChangeLog
Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig
Source/ThirdParty/libwebrtc/Source/webrtc/base/checks.h
Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/Configurations/WebCore.xcconfig
Source/WebCore/Configurations/WebCoreTestSupport.xcconfig
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/WebKit2/Configurations/WebKit.xcconfig
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/WebPreferences.cpp
Tools/ChangeLog
Tools/Scripts/build-webkit
Tools/Scripts/webkitdirs.pm
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig

index eb6a7b7..5251679 100644 (file)
@@ -1,3 +1,31 @@
+2017-02-21  Youenn Fablet  <youenn@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  <pvollan@apple.com>
 
         Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering.
index 799a9a2..a06d07b 100644 (file)
@@ -692,6 +692,14 @@ media/session [ Skip ]
 # 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 ]
index d41c940..3ed9117 100644 (file)
@@ -11,23 +11,7 @@ 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
+FAIL Error in promise chain: TypeError: undefined is not an object (evaluating 'pc.getTransceivers()[0].mid')
 PASS successfullyParsed is true
 
 TEST COMPLETE
index de12818..54be173 100644 (file)
@@ -4,28 +4,28 @@ 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
+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)
 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
index c225fc4..5cfa871 100644 (file)
@@ -3,26 +3,23 @@ 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
-
+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
index c2a80ba..a8d8117 100644 (file)
@@ -48,11 +48,6 @@ 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
 
index bc6d91c..21a120a 100644 (file)
@@ -1,3 +1,15 @@
+2017-02-21  Youenn Fablet  <youennf@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.bellessort@crf.canon.fr>
 
         [Readable Streams API] Add ReadableStreamBYOBRequest view getter
index c0f3d2b..d0f4f2e 100644 (file)
@@ -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"
 
index 15d01b9..96d7535 100644 (file)
@@ -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
 
 
index dd120af..bca7f50 100644 (file)
@@ -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
 
 
index 8ca6227..a960787 100644 (file)
@@ -340,6 +340,15 @@ webkit.org/b/160996 fast/mediastream/MediaStream-video-element-video-tracks-disa
 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 ]
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt
new file mode 100644 (file)
index 0000000..12a5aa3
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addIceCandidate-expected.txt
new file mode 100644 (file)
index 0000000..d41c940
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-addTrack-reuse-sender-expected.txt
new file mode 100644 (file)
index 0000000..de12818
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt
new file mode 100644 (file)
index 0000000..5893364
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-icecandidate-event-expected.txt
new file mode 100644 (file)
index 0000000..c225fc4
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event-expected.txt
new file mode 100644 (file)
index 0000000..128c554
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-legacy-stream-based-api-expected.txt
new file mode 100644 (file)
index 0000000..c2a80ba
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt
new file mode 100644 (file)
index 0000000..9e3d7d2
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCPeerConnection-overloaded-operations-params-expected.txt
new file mode 100644 (file)
index 0000000..81fc68e
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/RTCRtpSender-replaceTrack-expected.txt
new file mode 100644 (file)
index 0000000..601de3a
--- /dev/null
@@ -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
+
diff --git a/LayoutTests/platform/gtk/fast/mediastream/no-media-call-expected.txt b/LayoutTests/platform/gtk/fast/mediastream/no-media-call-expected.txt
new file mode 100644 (file)
index 0000000..96d7535
--- /dev/null
@@ -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
+
+
index 0862d3d..9f53d8f 100644 (file)
@@ -1915,3 +1915,5 @@ fast/css/deferred-parsing/hover-test.html [ Skip ]
 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 ]
index 263dafe..fba8da4 100644 (file)
@@ -94,6 +94,9 @@ fast/mediastream
 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
index e76f930..9619006 100644 (file)
@@ -1,3 +1,13 @@
+2017-02-21  Youenn Fablet  <youenn@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  <sbarati@apple.com>
 
         Add the Briggs optimistic allocator to run on ARM64
index 6a57202..bd58b29 100644 (file)
@@ -163,7 +163,15 @@ ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
 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;
index 93d74da..553adb3 100644 (file)
@@ -1,3 +1,17 @@
+2017-02-21  Youenn Fablet  <youenn@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  <achristensen@webkit.org>
 
         Don't build libwebrtc on 32-bit architectures
index e1138a4..84dbb93 100644 (file)
@@ -8,7 +8,6 @@ COMBINE_HIDPI_IMAGES = NO;
 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 @@ GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*] = $(inherited) WEBRTC_IOS;
 
 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;
index a703eab..8e8b90a 100644 (file)
@@ -211,7 +211,7 @@ DEFINE_RTC_CHECK_OP_IMPL(Gt)
 #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
index 55bf8d7..c1be459 100644 (file)
                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 */; };
                                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 */,
index 0c55163..b13312e 100644 (file)
@@ -1,3 +1,12 @@
+2017-02-21  Youenn Fablet  <youenn@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  <fpizlo@apple.com>
 
         The collector thread should only start when the mutator doesn't have heap access
index d88cfad..8fdeb4c 100644 (file)
 #define HAVE_CORE_PREDICTION 1
 #endif
 
+#if PLATFORM(MAC) && ENABLE(WEB_RTC)
+#define USE_LIBWEBRTC 1
+#endif
+
 #endif /* WTF_Platform_h */
index 76a4390..0e96db1 100644 (file)
@@ -1,3 +1,14 @@
+2017-02-21  Youenn Fablet  <youenn@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  <cgarcia@igalia.com>
 
         Unreviewed. Fix WinCairo build after r212703.
index 6a57202..bd58b29 100644 (file)
@@ -163,7 +163,15 @@ ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
 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;
index d5bf298..f101e2d 100644 (file)
@@ -66,12 +66,16 @@ WK_IOS_BINCOMPAT_LDFLAGS_V9_0 = -Wl,-reexport_library,$(BUILT_PRODUCTS_DIR)/Deri
 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;
index 25f3491..20f3e49 100644 (file)
@@ -44,12 +44,17 @@ DYLIB_INSTALL_NAME_BASE_Production = $(INSTALL_PATH);
 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 = ;
index 8ed59b0..73ffb85 100644 (file)
@@ -1,3 +1,12 @@
+2017-02-21  Youenn Fablet  <youenn@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  <rego@igalia.com>
 
         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
index 6a57202..bd58b29 100644 (file)
@@ -163,7 +163,15 @@ ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
 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;
index acdac2f..9e268b4 100644 (file)
@@ -1,3 +1,13 @@
+2017-02-21  Youenn Fablet  <youenn@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_jain@apple.com>
 
         Export various NSString symbols from WebFramePrivate.h
index 6a57202..bd58b29 100644 (file)
@@ -163,7 +163,15 @@ ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
 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;
index e99eb7b..f0a9827 100644 (file)
@@ -1,3 +1,19 @@
+2017-02-21  Youenn Fablet  <youenn@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-queue@webkit.org>
 
         Unreviewed, rolling out r212786.
index 6a57202..bd58b29 100644 (file)
@@ -163,7 +163,15 @@ ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
 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;
index a6b9698..9c6b38a 100644 (file)
@@ -46,10 +46,14 @@ EXTRA_FRAMEWORK_AND_LIBRARY_LDFLAGS_101300 = -framework CorePrediction;
 // 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__18functionIFvN7WebCore12PolicyActionEEED1Ev -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;
index 25ed9f8..7b6838c 100644 (file)
 //   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") \
     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") \
index dc33bfe..29739d6 100644 (file)
@@ -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 @@ FOR_EACH_WEBKIT_DEBUG_PREFERENCE(DEFINE_PREFERENCE_GETTER_AND_SETTERS)
 
 #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) \
     { \
index b4d4481..808dd32 100644 (file)
@@ -1,3 +1,19 @@
+2017-02-21  Youenn Fablet  <youenn@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  <sbarati@apple.com>
 
         Add the Briggs optimistic allocator to run on ARM64
index f49813c..749a732 100755 (executable)
@@ -63,6 +63,7 @@ my $onlyWebKitProject = 0;
 my $coverageSupport = 0;
 my $shouldRunStaticAnalyzer = 0;
 my $startTime = time();
+my $archsi386 = 0;
 
 my @features = getFeatureOptionList();
 
@@ -73,6 +74,8 @@ push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'})
 foreach (@ARGV) {
     if ($_ eq '--minimal') {
         $minimal = 1;
+    } elsif ($_ eq 'ARCHS=i386') {
+        $archsi386 = 1;
     }
 }
 
@@ -184,6 +187,9 @@ if (isAppleCocoaWebKit()) {
 
     # 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");
 
index 030cd9f..2fb7670 100755 (executable)
@@ -2137,6 +2137,8 @@ sub setupMacWebKitEnvironment($)
 
     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();
index 6a57202..bd58b29 100644 (file)
@@ -163,7 +163,15 @@ ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
 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;