Changeset 213234 in webkit


Ignore:
Timestamp:
Mar 1, 2017, 11:30:29 AM (8 years ago)
Author:
achristensen@apple.com
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:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r213230 r213234  
     12017-03-01  Alex Christensen  <achristensen@webkit.org>
     2
     3        Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
     4        https://bugs.webkit.org/show_bug.cgi?id=169045
     5        <rdar://problem/30735413>
     6
     7        Reviewed by Youenn Fablet.
     8
     9        WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
     10        All other tests pass instead of crashing immediately when creating an Internals object.
     11
     12        * Modules/mediastream/RTCController.cpp:
     13        (WebCore::RTCController::disableICECandidateFiltering):
     14        (WebCore::RTCController::enableICECandidateFiltering):
     15        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
     16        (WebCore::createLibWebRTCPeerConnectionBackend):
     17        * testing/Internals.cpp:
     18        (WebCore::Internals::enableMockMediaEndpoint):
     19        (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
     20        (WebCore::Internals::useMockRTCPeerConnectionFactory):
     21        * testing/Internals.h:
     22
    1232017-03-01  Javier Fernandez  <jfernandez@igalia.com>
    224
  • trunk/Source/WebCore/Modules/mediastream/RTCController.cpp

    r212745 r213234  
    2828#if ENABLE(WEB_RTC)
    2929
     30#include "LibWebRTCProvider.h"
    3031#include "RTCPeerConnection.h"
    3132
     
    4849void RTCController::disableICECandidateFiltering()
    4950{
     51    if (!LibWebRTCProvider::webRTCAvailable())
     52        return;
     53
    5054    m_shouldFilterICECandidates = false;
    5155    for (RTCPeerConnection& connection : m_peerConnections)
     
    5559void RTCController::enableICECandidateFiltering()
    5660{
     61    if (!LibWebRTCProvider::webRTCAvailable())
     62        return;
     63
    5764    m_shouldFilterICECandidates = true;
    5865    for (RTCPeerConnection& connection : m_peerConnections)
  • trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp

    r212338 r213234  
    4646static std::unique_ptr<PeerConnectionBackend> createLibWebRTCPeerConnectionBackend(RTCPeerConnection& peerConnection)
    4747{
     48    if (!LibWebRTCProvider::webRTCAvailable())
     49        return nullptr;
    4850    return std::make_unique<LibWebRTCPeerConnectionBackend>(peerConnection);
    4951}
  • trunk/Source/WebCore/testing/Internals.cpp

    r213214 r213234  
    11391139void Internals::enableMockMediaEndpoint()
    11401140{
     1141    if (!LibWebRTCProvider::webRTCAvailable())
     1142        return;
     1143
    11411144    MediaEndpoint::create = MockMediaEndpoint::create;
    11421145}
     
    11441147void Internals::emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection& connection, const String& action)
    11451148{
     1149    if (!LibWebRTCProvider::webRTCAvailable())
     1150        return;
     1151
    11461152    connection.emulatePlatformEvent(action);
    11471153}
     
    11491155void Internals::useMockRTCPeerConnectionFactory(const String& testCase)
    11501156{
     1157    if (!LibWebRTCProvider::webRTCAvailable())
     1158        return;
     1159
    11511160#if USE(LIBWEBRTC)
    11521161    Document* document = contextDocument();
  • trunk/Source/WebCore/testing/Internals.h

    r213169 r213234  
    397397#if ENABLE(WEB_RTC)
    398398    void enableMockMediaEndpoint();
    399     void enableMockRTCPeerConnectionHandler();
    400399    void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection&, const String& action);
    401400    void useMockRTCPeerConnectionFactory(const String&);
Note: See TracChangeset for help on using the changeset viewer.