Changeset 211253 in webkit
- Timestamp:
- Jan 26, 2017 8:54:09 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r211250 r211253 1 2017-01-26 Youenn Fablet <youennf@gmail.com> 2 3 [WebRTC] Add a LibWebRTC mock for testing 4 https://bugs.webkit.org/show_bug.cgi?id=167429 5 6 Reviewed by Alex Christensen. 7 8 * TestExpectations: Marking webrtc new tests as skipped for the moment. 9 * fast/mediastream/RTCPeerConnection-createAnswer.html: 10 * fast/mediastream/RTCPeerConnection-icecandidate-event.html: 11 * fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html: 12 * webrtc/datachannel/basic.html: Added. 13 * webrtc/routines.js: Added. 14 (createConnections): 15 (closeConnections): 16 (onCreateSessionDescriptionError): 17 (gotDescription1): 18 (gotDescription2): 19 (iceCallback1): 20 (iceCallback2): 21 (onAddIceCandidateSuccess): 22 (onAddIceCandidateError): 23 * webrtc/video.html: Added. 24 1 25 2017-01-26 Daniel Bates <dabates@apple.com> 2 26 -
trunk/LayoutTests/TestExpectations
r211169 r211253 680 680 media/session [ Skip ] 681 681 682 # WebRTC backend not enabled by default. 683 webrtc [ Skip ] 684 682 685 # Only iOS WK1 has testRunner.setPagePaused. 683 686 fast/dom/timer-fire-after-page-pause.html [ Skip ] -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-createAnswer.html
r208057 r211253 68 68 testPassed('createAnswer request succeeded.'); 69 69 70 sessionDescription = new RTCSessionDescription({type:"offer", sdp:" remote"});70 sessionDescription = new RTCSessionDescription({type:"offer", sdp:"v=0\r\no=- 5667094644266930845 0 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"}); 71 71 shouldNotThrow('pc.setRemoteDescription(sessionDescription, setDescriptionSucceeded, setDescriptionFailed);'); 72 72 } 73 73 74 function setDescriptionFailed( )74 function setDescriptionFailed(message) 75 75 { 76 testFailed('setRemoteDescription failed .');76 testFailed('setRemoteDescription failed: ' + message); 77 77 78 78 finishJSTest(); … … 82 82 { 83 83 testPassed('setRemoteDescription succeeded.'); 84 shouldThrow('pc.createAnswer(requestSucceeded2, requestFailed2, {});');84 pc.createAnswer(requestSucceeded2, requestFailed2, {}); 85 85 } 86 86 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-icecandidate-event.html
r208057 r211253 10 10 11 11 description("Test RTCPeerConnection 'icecandidate' event and gathering done"); 12 13 if (window.internals) 14 internals.useMockRTCPeerConnectionFactory("ICECandidates"); 12 15 13 16 if (window.testRunner) -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html
r208057 r211253 8 8 <script> 9 9 description("Test RTCPeerConnection 'iceconnectionstatechange' event"); 10 11 if (window.internals) 12 internals.useMockRTCPeerConnectionFactory("ICEConnectionState"); 10 13 11 14 let expectedState; -
trunk/Source/WebCore/ChangeLog
r211249 r211253 1 2017-01-26 Youenn Fablet <youennf@gmail.com> 2 3 [WebRTC] Add a LibWebRTC mock for testing 4 https://bugs.webkit.org/show_bug.cgi?id=167429 5 6 Reviewed by Alex Christensen. 7 8 Covered by updated tests although feature is behind a flag, off by default. 9 MockLibWebRTCPeerConnection will allow us testing the code above the WebRTC implementation above LibWebRTC, 10 without reyling on it and controlling the way that the peer connections will behave. 11 Adding support for mock factory to create real peer connections in case where we want to do full testing through the local loopback. 12 13 Tests: fast/mediastream/getUserMedia-webaudio.html 14 webrtc/datachannel/basic.html 15 webrtc/video.html 16 17 * WebCore.xcodeproj/project.pbxproj: 18 * testing/Internals.cpp: 19 (WebCore::Internals::Internals): 20 (WebCore::Internals::useMockRTCPeerConnectionFactory): 21 * testing/Internals.h: 22 * testing/Internals.idl: 23 * testing/MockLibWebRTCPeerConnection.cpp: Added. 24 (WebCore::useMockRTCPeerConnectionFactory): 25 (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::MockLibWebRTCPeerConnectionForIceCandidates): 26 (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription): 27 (WebCore::MockLibWebRTCPeerConnectionForIceConnectionState::MockLibWebRTCPeerConnectionForIceConnectionState): 28 (WebCore::MockLibWebRTCPeerConnectionForIceConnectionState::gotLocalDescription): 29 (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory): 30 (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection): 31 (WebCore::MockLibWebRTCPeerConnectionFactory::CreateLocalMediaStream): 32 (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription): 33 (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription): 34 (WebCore::MockLibWebRTCPeerConnection::CreateDataChannel): 35 (WebCore::MockLibWebRTCPeerConnection::AddStream): 36 (WebCore::MockLibWebRTCPeerConnection::RemoveStream): 37 (WebCore::MockLibWebRTCPeerConnection::CreateOffer): 38 (WebCore::MockLibWebRTCPeerConnection::CreateAnswer): 39 * testing/MockLibWebRTCPeerConnection.h: Added. 40 (WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection): 41 (WebCore::MockLibWebRTCPeerConnection::MockLibWebRTCPeerConnection): 42 (WebCore::MockLibWebRTCPeerConnection::local_streams): 43 (WebCore::MockLibWebRTCPeerConnection::remote_streams): 44 (WebCore::MockLibWebRTCPeerConnection::CreateDtmfSender): 45 (WebCore::MockLibWebRTCPeerConnection::GetStats): 46 (WebCore::MockLibWebRTCPeerConnection::local_description): 47 (WebCore::MockLibWebRTCPeerConnection::remote_description): 48 (WebCore::MockLibWebRTCPeerConnection::AddIceCandidate): 49 (WebCore::MockLibWebRTCPeerConnection::RegisterUMAObserver): 50 (WebCore::MockLibWebRTCPeerConnection::signaling_state): 51 (WebCore::MockLibWebRTCPeerConnection::ice_connection_state): 52 (WebCore::MockLibWebRTCPeerConnection::ice_gathering_state): 53 (WebCore::MockLibWebRTCPeerConnection::StopRtcEventLog): 54 (WebCore::MockLibWebRTCPeerConnection::Close): 55 (WebCore::MockLibWebRTCPeerConnection::gotLocalDescription): 56 (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate): 57 (WebCore::MockLibWebRTCAudioTrack::MockLibWebRTCAudioTrack): 58 (WebCore::MockLibWebRTCVideoTrack::MockLibWebRTCVideoTrack): 59 (WebCore::MockLibWebRTCDataChannel::MockLibWebRTCDataChannel): 60 (WebCore::MockLibWebRTCPeerConnectionFactory::create): 61 1 62 2017-01-26 Jeremy Jones <jeremyj@apple.com> 2 63 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r211227 r211253 1545 1545 4157AF8012F1FB0400A8C6F5 /* MediaControlsApple.h in Headers */ = {isa = PBXBuildFile; fileRef = 4157AF7E12F1FB0400A8C6F5 /* MediaControlsApple.h */; }; 1546 1546 4157AF8112F1FB0400A8C6F5 /* MediaControlsApple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4157AF7F12F1FB0400A8C6F5 /* MediaControlsApple.cpp */; }; 1547 4157EBFA1E3AB67900AC9FE9 /* MockLibWebRTCPeerConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4157EBF91E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.cpp */; }; 1548 4157EBFB1E3AB67F00AC9FE9 /* MockLibWebRTCPeerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4157EBF81E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.h */; }; 1547 1549 41614A781DA6423B004AD06F /* HTTPHeaderValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41614A761DA64236004AD06F /* HTTPHeaderValues.cpp */; }; 1548 1550 41614A791DA64241004AD06F /* HTTPHeaderValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 41614A771DA64236004AD06F /* HTTPHeaderValues.h */; }; … … 8726 8728 4157AF7E12F1FB0400A8C6F5 /* MediaControlsApple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControlsApple.h; sourceTree = "<group>"; }; 8727 8729 4157AF7F12F1FB0400A8C6F5 /* MediaControlsApple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlsApple.cpp; sourceTree = "<group>"; }; 8730 4157EBF81E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockLibWebRTCPeerConnection.h; sourceTree = "<group>"; }; 8731 4157EBF91E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockLibWebRTCPeerConnection.cpp; sourceTree = "<group>"; }; 8728 8732 41614A761DA64236004AD06F /* HTTPHeaderValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderValues.cpp; sourceTree = "<group>"; }; 8729 8733 41614A771DA64236004AD06F /* HTTPHeaderValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPHeaderValues.h; sourceTree = "<group>"; }; … … 16694 16698 51058AD91D679257009A538C /* MockGamepadProvider.cpp */, 16695 16699 51058ADA1D679257009A538C /* MockGamepadProvider.h */, 16700 4157EBF81E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.h */, 16701 4157EBF91E3AB06800AC9FE9 /* MockLibWebRTCPeerConnection.cpp */, 16696 16702 2D6F3E8A1C1ECB1C0061DBD4 /* MockPageOverlay.cpp */, 16697 16703 2D6F3E8B1C1ECB1C0061DBD4 /* MockPageOverlay.h */, … … 24912 24918 A1763F3F1E205234001D58DE /* WebArchiveDumpSupport.h in Headers */, 24913 24919 41815C1F138319830057AAA4 /* WebCoreTestSupport.h in Headers */, 24920 4157EBFB1E3AB67F00AC9FE9 /* MockLibWebRTCPeerConnection.h in Headers */, 24914 24921 ); 24915 24922 runOnlyForDeploymentPostprocessing = 0; … … 28835 28842 417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */, 28836 28843 A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */, 28844 4157EBFA1E3AB67900AC9FE9 /* MockLibWebRTCPeerConnection.cpp in Sources */, 28837 28845 53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */, 28838 28846 A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */, -
trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp
r211161 r211253 32 32 #if USE(LIBWEBRTC) 33 33 34 #include <webrtc/api/peerconnectionfactoryproxy.h> 34 35 #include <webrtc/api/peerconnectionfactory.h> 35 36 #include <webrtc/base/physicalsocketserver.h> … … 75 76 } 76 77 78 void callOnWebRTCSignalingThread(Function<void()>&& callback) 79 { 80 PeerConnectionFactoryAndThreads& threads = staticFactoryAndThreads(); 81 threads.signalingThread->Post(RTC_FROM_HERE, &threads, 1, new ThreadMessageData(WTFMove(callback))); 82 } 83 77 84 static void initializePeerConnectionFactoryAndThreads() 78 85 { … … 105 112 initializePeerConnectionFactoryAndThreads(); 106 113 return *staticFactoryAndThreads().factory; 114 } 115 116 void setPeerConnectionFactory(rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>&& factory) 117 { 118 if (!staticFactoryAndThreads().factory) 119 initializePeerConnectionFactoryAndThreads(); 120 121 staticFactoryAndThreads().factory = webrtc::PeerConnectionFactoryProxy::Create(staticFactoryAndThreads().signalingThread.get(), WTFMove(factory)); 107 122 } 108 123 -
trunk/Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.h
r211161 r211253 53 53 WEBCORE_EXPORT void callOnWebRTCNetworkThread(Function<void()>&&); 54 54 55 // Used for mock testing 56 WEBCORE_EXPORT void setPeerConnectionFactory(rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>&&); 57 WEBCORE_EXPORT void callOnWebRTCSignalingThread(Function<void()>&&); 58 55 59 } // namespace WebCore 56 60 -
trunk/Source/WebCore/testing/Internals.cpp
r211006 r211253 86 86 #include "InternalSettings.h" 87 87 #include "Language.h" 88 #include "LibWebRTCProvider.h" 89 #include "LibWebRTCUtils.h" 88 90 #include "MainFrame.h" 89 91 #include "MallocStatistics.h" … … 93 95 #include "MemoryInfo.h" 94 96 #include "MemoryPressureHandler.h" 97 #include "MockLibWebRTCPeerConnection.h" 95 98 #include "MockPageOverlay.h" 96 99 #include "MockPageOverlayClient.h" … … 451 454 #if ENABLE(WEB_RTC) 452 455 enableMockMediaEndpoint(); 456 useMockRTCPeerConnectionFactory(String()); 453 457 #endif 454 458 … … 1090 1094 { 1091 1095 connection.emulatePlatformEvent(action); 1096 } 1097 1098 void Internals::useMockRTCPeerConnectionFactory(const String& testCase) 1099 { 1100 #if USE(LIBWEBRTC) 1101 Document* document = contextDocument(); 1102 LibWebRTCProvider* provider = (document && document->page()) ? &document->page()->libWebRTCProvider() : nullptr; 1103 WebCore::useMockRTCPeerConnectionFactory(provider, testCase); 1104 #else 1105 UNUSED_PARAM(testCase); 1106 #endif 1092 1107 } 1093 1108 -
trunk/Source/WebCore/testing/Internals.h
r211006 r211253 391 391 void enableMockRTCPeerConnectionHandler(); 392 392 void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection&, const String& action); 393 void useMockRTCPeerConnectionFactory(const String&); 393 394 #endif 394 395 -
trunk/Source/WebCore/testing/Internals.idl
r211006 r211253 436 436 [Conditional=MEDIA_STREAM] void setMockMediaCaptureDevicesEnabled(boolean enabled); 437 437 [Conditional=WEB_RTC] void emulateRTCPeerConnectionPlatformEvent(RTCPeerConnection connection, DOMString action); 438 [Conditional=WEB_RTC] void useMockRTCPeerConnectionFactory(DOMString testCase); 438 439 439 440 [Conditional=VIDEO] void simulateSystemSleep();
Note: See TracChangeset
for help on using the changeset viewer.