Title: [213234] trunk/Source/WebCore
Revision
213234
Author
[email protected]
Date
2017-03-01 11:30:29 -0800 (Wed, 01 Mar 2017)

Log Message

Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
https://bugs.webkit.org/show_bug.cgi?id=169045
<rdar://problem/30735413>

Reviewed by Youenn Fablet.

WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
All other tests pass instead of crashing immediately when creating an Internals object.

* Modules/mediastream/RTCController.cpp:
(WebCore::RTCController::disableICECandidateFiltering):
(WebCore::RTCController::enableICECandidateFiltering):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* testing/Internals.cpp:
(WebCore::Internals::enableMockMediaEndpoint):
(WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
(WebCore::Internals::useMockRTCPeerConnectionFactory):
* testing/Internals.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (213233 => 213234)


--- trunk/Source/WebCore/ChangeLog	2017-03-01 19:13:37 UTC (rev 213233)
+++ trunk/Source/WebCore/ChangeLog	2017-03-01 19:30:29 UTC (rev 213234)
@@ -1,3 +1,25 @@
+2017-03-01  Alex Christensen  <[email protected]>
+
+        Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
+        https://bugs.webkit.org/show_bug.cgi?id=169045
+        <rdar://problem/30735413>
+
+        Reviewed by Youenn Fablet.
+
+        WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
+        All other tests pass instead of crashing immediately when creating an Internals object.
+
+        * Modules/mediastream/RTCController.cpp:
+        (WebCore::RTCController::disableICECandidateFiltering):
+        (WebCore::RTCController::enableICECandidateFiltering):
+        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
+        (WebCore::createLibWebRTCPeerConnectionBackend):
+        * testing/Internals.cpp:
+        (WebCore::Internals::enableMockMediaEndpoint):
+        (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
+        (WebCore::Internals::useMockRTCPeerConnectionFactory):
+        * testing/Internals.h:
+
 2017-03-01  Javier Fernandez  <[email protected]>
 
         [css-align] Implement the place-content shorthand

Modified: trunk/Source/WebCore/Modules/mediastream/RTCController.cpp (213233 => 213234)


--- trunk/Source/WebCore/Modules/mediastream/RTCController.cpp	2017-03-01 19:13:37 UTC (rev 213233)
+++ trunk/Source/WebCore/Modules/mediastream/RTCController.cpp	2017-03-01 19:30:29 UTC (rev 213234)
@@ -27,6 +27,7 @@
 
 #if ENABLE(WEB_RTC)
 
+#include "LibWebRTCProvider.h"
 #include "RTCPeerConnection.h"
 
 namespace WebCore {
@@ -47,6 +48,9 @@
 
 void RTCController::disableICECandidateFiltering()
 {
+    if (!LibWebRTCProvider::webRTCAvailable())
+        return;
+
     m_shouldFilterICECandidates = false;
     for (RTCPeerConnection& connection : m_peerConnections)
         connection.disableICECandidateFiltering();
@@ -54,6 +58,9 @@
 
 void RTCController::enableICECandidateFiltering()
 {
+    if (!LibWebRTCProvider::webRTCAvailable())
+        return;
+
     m_shouldFilterICECandidates = true;
     for (RTCPeerConnection& connection : m_peerConnections)
         connection.enableICECandidateFiltering();

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp (213233 => 213234)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2017-03-01 19:13:37 UTC (rev 213233)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp	2017-03-01 19:30:29 UTC (rev 213234)
@@ -45,6 +45,8 @@
 
 static std::unique_ptr<PeerConnectionBackend> createLibWebRTCPeerConnectionBackend(RTCPeerConnection& peerConnection)
 {
+    if (!LibWebRTCProvider::webRTCAvailable())
+        return nullptr;
     return std::make_unique<LibWebRTCPeerConnectionBackend>(peerConnection);
 }
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (213233 => 213234)


--- trunk/Source/WebCore/testing/Internals.cpp	2017-03-01 19:13:37 UTC (rev 213233)
+++ trunk/Source/WebCore/testing/Internals.cpp	2017-03-01 19:30:29 UTC (rev 213234)
@@ -1138,16 +1138,25 @@
 
 void Internals::enableMockMediaEndpoint()
 {
+    if (!LibWebRTCProvider::webRTCAvailable())
+        return;
+
     MediaEndpoint::create = MockMediaEndpoint::create;
 }
 
 void Internals::emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection& connection, const String& action)
 {
+    if (!LibWebRTCProvider::webRTCAvailable())
+        return;
+
     connection.emulatePlatformEvent(action);
 }
 
 void Internals::useMockRTCPeerConnectionFactory(const String& testCase)
 {
+    if (!LibWebRTCProvider::webRTCAvailable())
+        return;
+
 #if USE(LIBWEBRTC)
     Document* document = contextDocument();
     LibWebRTCProvider* provider = (document && document->page()) ? &document->page()->libWebRTCProvider() : nullptr;

Modified: trunk/Source/WebCore/testing/Internals.h (213233 => 213234)


--- trunk/Source/WebCore/testing/Internals.h	2017-03-01 19:13:37 UTC (rev 213233)
+++ trunk/Source/WebCore/testing/Internals.h	2017-03-01 19:30:29 UTC (rev 213234)
@@ -396,7 +396,6 @@
 
 #if ENABLE(WEB_RTC)
     void enableMockMediaEndpoint();
-    void enableMockRTCPeerConnectionHandler();
     void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection&, const String& action);
     void useMockRTCPeerConnectionFactory(const String&);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to