Changeset 144808 in webkit
- Timestamp:
- Mar 5, 2013 1:15:53 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r144807 r144808 1 2013-03-05 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Allow local and remote descriptions to be accessed after close 4 https://bugs.webkit.org/show_bug.cgi?id=111437 5 6 Reviewed by Adam Barth. 7 8 Expanding tests to check the new behaviour. 9 10 * fast/mediastream/RTCPeerConnection-localDescription-expected.txt: 11 * fast/mediastream/RTCPeerConnection-localDescription.html: 12 * fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt: 13 * fast/mediastream/RTCPeerConnection-remoteDescription.html: 14 1 15 2013-03-05 Eric Seidel <eric@webkit.org> 2 16 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription-expected.txt
r127906 r144808 9 9 PASS requestFailed was called. 10 10 PASS pc.localDescription.type is "offer" 11 PASS pc.localDescription.sdp is "local" 12 PASS pc.localDescription.type is "offer" 13 PASS pc.localDescription.sdp is "local" 11 14 PASS successfullyParsed is true 12 15 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-localDescription.html
r127906 r144808 14 14 testPassed('requestFailed was called.'); 15 15 16 shouldBe('pc.localDescription.type', '"offer"'); 16 shouldBeEqualToString('pc.localDescription.type', "offer"); 17 shouldBeEqualToString('pc.localDescription.sdp', "local"); 18 pc.close(); 19 shouldBeEqualToString('pc.localDescription.type', "offer"); 20 shouldBeEqualToString('pc.localDescription.sdp', "local"); 21 17 22 finishJSTest(); 18 23 } -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription-expected.txt
r127906 r144808 9 9 PASS requestFailed was called. 10 10 PASS pc.remoteDescription.type is "answer" 11 PASS pc.remoteDescription.sdp is "remote" 12 PASS pc.remoteDescription.type is "answer" 13 PASS pc.remoteDescription.sdp is "remote" 11 14 PASS successfullyParsed is true 12 15 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-remoteDescription.html
r127906 r144808 14 14 testPassed('requestFailed was called.'); 15 15 16 shouldBe('pc.remoteDescription.type', '"answer"'); 16 shouldBeEqualToString('pc.remoteDescription.type', "answer"); 17 shouldBeEqualToString('pc.remoteDescription.sdp', "remote"); 18 pc.close(); 19 shouldBeEqualToString('pc.remoteDescription.type', "answer"); 20 shouldBeEqualToString('pc.remoteDescription.sdp', "remote"); 21 17 22 finishJSTest(); 18 23 } -
trunk/Source/WebCore/ChangeLog
r144805 r144808 1 2013-03-05 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Allow local and remote descriptions to be accessed after close 4 https://bugs.webkit.org/show_bug.cgi?id=111437 5 6 Reviewed by Adam Barth. 7 8 It's quite clear in the standard that the getters should still return the old value. 9 Also overhauling the state setters a bit to check if the new state is different. 10 11 Existing tests expanded to cover patch. 12 13 * Modules/mediastream/RTCPeerConnection.cpp: 14 (WebCore::RTCPeerConnection::localDescription): 15 (WebCore::RTCPeerConnection::remoteDescription): 16 (WebCore::RTCPeerConnection::changeSignalingState): 17 (WebCore::RTCPeerConnection::changeIceGatheringState): 18 (WebCore::RTCPeerConnection::changeIceConnectionState): 19 1 20 2013-03-05 Charlie Reis <creis@chromium.org> 2 21 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r144748 r144808 226 226 PassRefPtr<RTCSessionDescription> RTCPeerConnection::localDescription(ExceptionCode& ec) 227 227 { 228 if (m_signalingState == SignalingStateClosed) {229 ec = INVALID_STATE_ERR;230 return 0;231 }232 233 228 RefPtr<RTCSessionDescriptionDescriptor> descriptor = m_peerHandler->localDescription(); 234 229 if (!descriptor) … … 258 253 PassRefPtr<RTCSessionDescription> RTCPeerConnection::remoteDescription(ExceptionCode& ec) 259 254 { 260 if (m_signalingState == SignalingStateClosed) {261 ec = INVALID_STATE_ERR;262 return 0;263 }264 265 255 RefPtr<RTCSessionDescriptionDescriptor> descriptor = m_peerHandler->remoteDescription(); 266 256 if (!descriptor) … … 632 622 void RTCPeerConnection::changeSignalingState(SignalingState signalingState) 633 623 { 634 ASSERT(m_signalingState != SignalingStateClosed); 635 m_signalingState = signalingState; 636 scheduleDispatchEvent(Event::create(eventNames().statechangeEvent, false, false)); 624 if (m_signalingState != SignalingStateClosed && m_signalingState != signalingState) { 625 m_signalingState = signalingState; 626 scheduleDispatchEvent(Event::create(eventNames().statechangeEvent, false, false)); 627 } 637 628 } 638 629 639 630 void RTCPeerConnection::changeIceGatheringState(IceGatheringState iceGatheringState) 640 631 { 641 m_iceGatheringState = iceGatheringState; 642 scheduleDispatchEvent(Event::create(eventNames().gatheringchangeEvent, false, false)); 632 if (m_iceGatheringState != iceGatheringState) { 633 m_iceGatheringState = iceGatheringState; 634 scheduleDispatchEvent(Event::create(eventNames().gatheringchangeEvent, false, false)); 635 } 643 636 } 644 637 645 638 void RTCPeerConnection::changeIceConnectionState(IceConnectionState iceConnectionState) 646 639 { 647 m_iceConnectionState = iceConnectionState; 648 scheduleDispatchEvent(Event::create(eventNames().icechangeEvent, false, false)); 640 if (m_iceConnectionState != IceConnectionStateClosed && m_iceConnectionState != iceConnectionState) { 641 m_iceConnectionState = iceConnectionState; 642 scheduleDispatchEvent(Event::create(eventNames().icechangeEvent, false, false)); 643 } 649 644 } 650 645
Note: See TracChangeset
for help on using the changeset viewer.