Changeset 202339 in webkit
- Timestamp:
- Jun 22, 2016 11:15:40 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r202334 r202339 1 2016-06-22 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: Add support for the negotiationneeded event in MediaEndpointPeerConnection 4 https://bugs.webkit.org/show_bug.cgi?id=158985 5 6 Add tests for the RTCPeerConnection negotiationneeded event. 7 8 Reviewed by Eric Carlson. 9 10 * fast/mediastream/RTCPeerConnection-more-media-to-negotiate-expected.txt: Added. 11 * fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html: Added. 12 Verify that a negotiationneeded event is fired when not all local media can be included in 13 an answer. (The answerer cannot reply with more m-lines than the offer had to begin with.) 14 * fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt: 15 * fast/mediastream/RTCPeerConnection-onnegotiationneeded.html: 16 Verify that a negotiationneeded event is fired when tracks are added and removed from an 17 RTCPeerConnection. 18 * platform/gtk/TestExpectations: 19 Unskip fast/mediastream/RTCPeerConnection-onnegotiationneeded.html. 20 * platform/mac/TestExpectations: 21 The mac port does not build with WEB_RTC enabled yet. 22 1 23 2016-06-22 Youenn Fablet <youennf@gmail.com> 2 24 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-onnegotiationneeded-expected.txt
r160181 r202339 5 5 6 6 PASS Got a stream. 7 PASS onNegotiationNeeded was called. 8 PASS stream.getAudioTracks().length is 1 9 PASS stream.getAudioTracks().length is 0 10 PASS onNegotiationNeeded was called when track was removed. 11 PASS stream.getAudioTracks().length is 0 12 PASS stream.getAudioTracks().length is 1 13 PASS onNegotiationNeeded was called when track was added. 7 PASS onNegotiationNeeded was called when a track was added. 8 PASS onNegotiationNeeded2 was called when a track was removed. 9 PASS onNegotiationNeeded3 was called when a track was added. 14 10 PASS successfullyParsed is true 15 11 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-onnegotiationneeded.html
r164602 r202339 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">1 <!DOCTYPE html> 2 2 <html> 3 3 <head> … … 8 8 description("Tests RTCPeerConnection onnegotiationneeded."); 9 9 10 var stream = null;11 var pc = null;12 var track = null;10 let stream; 11 let pc; 12 let audioSender; 13 13 14 14 function error() … … 18 18 } 19 19 20 function getUserMedia(dictionary, callback)21 {22 try {23 navigator.webkitGetUserMedia(dictionary, callback, error);24 } catch (e) {25 testFailed('webkitGetUserMedia threw exception :' + e);26 finishJSTest();27 }28 }29 30 20 function onNegotiationNeeded(event) 31 21 { 32 testPassed('onNegotiationNeeded was called .');22 testPassed('onNegotiationNeeded was called when a track was added.'); 33 23 removeTrack(); 34 24 } … … 36 26 function onNegotiationNeeded2(event) 37 27 { 38 testPassed('onNegotiationNeeded was called whentrack was removed.');28 testPassed('onNegotiationNeeded2 was called when a track was removed.'); 39 29 addTrack(); 40 30 } … … 42 32 function onNegotiationNeeded3(event) 43 33 { 44 testPassed('onNegotiationNeeded was called whentrack was added.');34 testPassed('onNegotiationNeeded3 was called when a track was added.'); 45 35 finishJSTest(); 46 36 } … … 54 44 pc.onnegotiationneeded = onNegotiationNeeded; 55 45 56 pc.addStream(stream);46 audioSender = pc.addTrack(stream.getAudioTracks()[0], stream); 57 47 } 58 48 … … 60 50 { 61 51 pc.onnegotiationneeded = onNegotiationNeeded2; 62 shouldBe('stream.getAudioTracks().length', '1'); 63 track = stream.getAudioTracks()[0]; 64 stream.removeTrack(track); 65 shouldBe('stream.getAudioTracks().length', '0'); 52 pc.removeTrack(audioSender); 66 53 } 67 54 … … 69 56 { 70 57 pc.onnegotiationneeded = onNegotiationNeeded3; 71 shouldBe('stream.getAudioTracks().length', '0'); 72 stream.addTrack(track); 73 shouldBe('stream.getAudioTracks().length', '1'); 58 pc.addTrack(stream.getVideoTracks()[0], stream); 74 59 } 75 60 76 getUserMedia({audio:true, video:true}, gotStream); 61 if (window.testRunner) 62 testRunner.setUserMediaPermission(true); 63 else { 64 debug("This test can not be run without the testRunner"); 65 finishJSTest(); 66 } 67 68 navigator.mediaDevices.getUserMedia({audio:true, video:true}).then(gotStream).catch(error); 77 69 78 70 window.jsTestIsAsync = true; -
trunk/LayoutTests/platform/gtk/TestExpectations
r202220 r202339 350 350 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-ice.html [ Skip ] 351 351 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-localDescription.html [ Skip ] 352 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-onnegotiationneeded.html [ Skip ]353 352 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-remoteDescription.html [ Skip ] 354 353 webkit.org/b/79203 fast/mediastream/RTCPeerConnection-stable.html [ Skip ] -
trunk/LayoutTests/platform/mac/TestExpectations
r202322 r202339 190 190 fast/mediastream/RTCPeerConnection-add-removeTrack.html 191 191 fast/mediastream/RTCPeerConnection-addTrack-reuse-sender.html 192 fast/mediastream/RTCPeerConnection-onnegotiationneeded.html 193 fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html 192 194 fast/mediastream/RTCPeerConnection-closed-state.html 193 195 fast/mediastream/RTCPeerConnection-overloaded-operations-params.html -
trunk/Source/WebCore/ChangeLog
r202337 r202339 1 2016-06-22 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 3 WebRTC: Add support for the negotiationneeded event in MediaEndpointPeerConnection 4 https://bugs.webkit.org/show_bug.cgi?id=158985 5 6 Reviewed by Eric Carlson. 7 8 Implement MediaEndpointPeerConnection's isNegotiationNeeded, markAsNeedingNegotiation and 9 clearNegotiationNeededState functions. The calls to these functions are already up-to-date. 10 11 Test: fast/mediastream/RTCPeerConnection-more-media-to-negotiate.html 12 13 * Modules/mediastream/MediaEndpointPeerConnection.cpp: 14 (WebCore::MediaEndpointPeerConnection::markAsNeedingNegotiation): 15 * Modules/mediastream/MediaEndpointPeerConnection.h: 16 * Modules/mediastream/RTCPeerConnection.cpp: 17 (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent): 18 1 19 2016-06-22 Adam Bergkvist <adam.bergkvist@ericsson.com> 2 20 -
trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.cpp
r202293 r202339 722 722 void MediaEndpointPeerConnection::markAsNeedingNegotiation() 723 723 { 724 notImplemented(); 724 if (m_negotiationNeeded) 725 return; 726 727 m_negotiationNeeded = true; 728 729 if (m_client->internalSignalingState() == SignalingState::Stable) 730 m_client->scheduleNegotiationNeededEvent(); 725 731 } 726 732 -
trunk/Source/WebCore/Modules/mediastream/MediaEndpointPeerConnection.h
r202293 r202339 79 79 void stop() override; 80 80 81 bool isNegotiationNeeded() const override { return false; };82 void markAsNeedingNegotiation() override;83 void clearNegotiationNeededState() override { notImplemented(); };81 bool isNegotiationNeeded() const override { return m_negotiationNeeded; }; 82 void markAsNeedingNegotiation(); 83 void clearNegotiationNeededState() override { m_negotiationNeeded = false; }; 84 84 85 85 private: -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r202337 r202339 477 477 scriptExecutionContext()->postTask([=](ScriptExecutionContext&) { 478 478 if (m_backend->isNegotiationNeeded()) { 479 m_backend->clearNegotiationNeededState(); 479 480 dispatchEvent(Event::create(eventNames().negotiationneededEvent, false, false)); 480 m_backend->clearNegotiationNeededState();481 481 } 482 482 });
Note: See TracChangeset
for help on using the changeset viewer.