Changeset 144748 in webkit
- Timestamp:
- Mar 5, 2013 3:34:38 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r144747 r144748 1 2013-03-05 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the getStreamById method on RTCPeerConnection 4 https://bugs.webkit.org/show_bug.cgi?id=111311 5 6 Reviewed by Adam Barth. 7 8 * fast/mediastream/MediaStream-add-remove-tracks.html: 9 * fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt: 10 * fast/mediastream/RTCPeerConnection-AddRemoveStream.html: 11 1 12 2013-03-05 Antoine Quint <graouts@apple.com> 2 13 -
trunk/LayoutTests/fast/mediastream/MediaStream-add-remove-tracks.html
r144610 r144748 84 84 // (re-)add tracks 85 85 tryAddTrack(stream1, audioTrack); 86 tryAddTrack(stream1, videoTrack); 86 tryAddTrack(stream1, videoTrack); 87 87 88 88 // verify added tracks -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream-expected.txt
r141871 r144748 6 6 PASS Got a stream. 7 7 PASS Got another stream. 8 PASS stream.id === stream2.id is false 8 9 PASS onAddStream was called. 10 PASS pc.getStreamById(stream.id) is stream 11 PASS pc.getStreamById(stream2.id) is null 9 12 PASS pc.getLocalStreams().length is 1 10 13 PASS pc.getLocalStreams().length is 1 -
trunk/LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream.html
r141871 r144748 26 26 } 27 27 28 function onErroneous RemoveStream() {29 testFailed('onErroneous RemoveStreamwas called.');28 function onErroneousNegotiationNeeded() { 29 testFailed('onErroneousNegotiationNeeded was called.'); 30 30 finishJSTest(); 31 31 } … … 39 39 } 40 40 41 function onErroneousAddStream() {42 testFailed('onErroneousAddStream was called.');43 finishJSTest();44 }45 46 41 function onAddStream(event) { 47 42 testPassed('onAddStream was called.'); 48 43 49 pc.onaddstream = onErroneousAddStream; 44 shouldBe('pc.getStreamById(stream.id)', 'stream'); 45 shouldBe('pc.getStreamById(stream2.id)', 'null'); 46 47 pc.onnegotiationneeded = onErroneousNegotiationNeeded; 50 48 pc.addStream(stream); 51 49 shouldBe('pc.getLocalStreams().length', '1'); 52 53 pc.onremovestream = onErroneousRemoveStream;54 50 pc.removeStream(stream2); 55 51 shouldBe('pc.getLocalStreams().length', '1'); 56 52 57 pc.on removestream= onRemoveStream;53 pc.onnegotiationneeded = onRemoveStream; 58 54 pc.removeStream(stream); 59 55 } … … 63 59 stream2 = s; 64 60 61 shouldBeFalse("stream.id === stream2.id"); 62 65 63 pc = new webkitRTCPeerConnection(null, null); 66 67 pc.onaddstream = onAddStream; 64 pc.onnegotiationneeded = onAddStream; 68 65 pc.addStream(stream); 69 66 } -
trunk/LayoutTests/platform/chromium/TestExpectations
r144736 r144748 4413 4413 # These test are failing since r144519 4414 4414 webkit.org/b/109769 [ Mac ] fast/events/touch/gesture/touch-gesture-noscroll-body-yhidden.html [ Failure ] 4415 webkit.org/b/109769 [ Mac ] fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html [ Failure ] 4416 4417 # New crashing test since r144610 4418 webkit.org/b/111410 [ Debug ] fast/mediastream/MediaStream-add-remove-tracks.html [ Crash ] 4415 webkit.org/b/109769 [ Mac ] fast/events/touch/gesture/touch-gesture-noscroll-body-propagated.html [ Failure ] -
trunk/Source/Platform/ChangeLog
r144720 r144748 1 2013-03-05 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the getStreamById method on RTCPeerConnection 4 https://bugs.webkit.org/show_bug.cgi?id=111311 5 6 Reviewed by Adam Barth. 7 8 Added an initial initialize method which doesn't take an id; 9 the id will be generated for you. 10 11 * chromium/public/WebMediaStream.h: 12 (WebMediaStream): 13 1 14 2013-03-04 Chris Rogers <crogers@google.com> 2 15 -
trunk/Source/Platform/chromium/public/WebMediaStream.h
r142773 r144748 63 63 WEBKIT_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources); 64 64 65 WEBKIT_EXPORT void initialize(const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks); 65 66 WEBKIT_EXPORT void initialize(const WebString& label, const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks); 66 67 -
trunk/Source/WebCore/ChangeLog
r144747 r144748 1 2013-03-05 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the getStreamById method on RTCPeerConnection 4 https://bugs.webkit.org/show_bug.cgi?id=111311 5 6 Reviewed by Adam Barth. 7 8 Adding the missing method on RTCPeerConnection defined here: 9 http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-RTCPeerConnection-getStreamById-MediaStream-DOMString-streamId 10 11 Existing tests have been extended to cover patch. 12 13 * Modules/mediastream/RTCPeerConnection.cpp: 14 (WebCore::RTCPeerConnection::getStreamById): 15 (WebCore): 16 * Modules/mediastream/RTCPeerConnection.h: 17 (RTCPeerConnection): 18 * Modules/mediastream/RTCPeerConnection.idl: 19 * platform/chromium/support/WebMediaStream.cpp: 20 (WebKit::WebMediaStream::initialize): 21 (WebKit): 22 * platform/mediastream/MediaStreamSource.cpp: 23 (WebCore::MediaStreamSource::setReadyState): 24 1 25 2013-03-05 Antoine Quint <graouts@apple.com> 2 26 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
r144568 r144748 432 432 } 433 433 434 MediaStream* RTCPeerConnection::getStreamById(const String& streamId) 435 { 436 for (MediaStreamVector::iterator iter = m_localStreams.begin(); iter != m_localStreams.end(); ++iter) { 437 if ((*iter)->id() == streamId) 438 return iter->get(); 439 } 440 441 for (MediaStreamVector::iterator iter = m_remoteStreams.begin(); iter != m_remoteStreams.end(); ++iter) { 442 if ((*iter)->id() == streamId) 443 return iter->get(); 444 } 445 446 return 0; 447 } 448 434 449 void RTCPeerConnection::getStats(PassRefPtr<RTCStatsCallback> successCallback, PassRefPtr<MediaStreamTrack> selector) 435 450 { -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h
r141984 r144748 90 90 MediaStreamVector getRemoteStreams() const; 91 91 92 MediaStream* getStreamById(const String& streamId); 93 92 94 void addStream(PassRefPtr<MediaStream>, const Dictionary& mediaConstraints, ExceptionCode&); 93 95 -
trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.idl
r141984 r144748 69 69 sequence<MediaStream> getLocalStreams(); 70 70 sequence<MediaStream> getRemoteStreams(); 71 MediaStream getStreamById(DOMString streamId); 71 72 72 73 [StrictTypeChecking] void addStream(in MediaStream stream, in [Optional] Dictionary mediaConstraints) -
trunk/Source/WebCore/platform/chromium/support/WebMediaStream.cpp
r142773 r144748 32 32 #include "MediaStreamDescriptor.h" 33 33 #include "MediaStreamSource.h" 34 #include "UUID.h" 34 35 #include <public/WebMediaStreamSource.h> 35 36 #include <public/WebMediaStreamTrack.h> … … 143 144 } 144 145 146 void WebMediaStream::initialize(const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks) 147 { 148 initialize(createCanonicalUUIDString(), audioTracks, videoTracks); 149 } 150 145 151 void WebMediaStream::initialize(const WebString& label, const WebVector<WebMediaStreamTrack>& audioTracks, const WebVector<WebMediaStreamTrack>& videoTracks) 146 152 { -
trunk/Source/WebCore/platform/mediastream/MediaStreamSource.cpp
r138895 r144748 54 54 void MediaStreamSource::setReadyState(ReadyState readyState) 55 55 { 56 ASSERT(m_readyState != ReadyStateEnded); 57 if (m_readyState != readyState) { 56 if (m_readyState != ReadyStateEnded && m_readyState != readyState) { 58 57 m_readyState = readyState; 59 58 for (Vector<Observer*>::iterator i = m_observers.begin(); i != m_observers.end(); ++i) -
trunk/Tools/ChangeLog
r144739 r144748 1 2013-03-05 Tommy Widenflycht <tommyw@google.com> 2 3 MediaStream API: Add the getStreamById method on RTCPeerConnection 4 https://bugs.webkit.org/show_bug.cgi?id=111311 5 6 Reviewed by Adam Barth. 7 8 Changing mocks to be more realistic. 9 10 * DumpRenderTree/chromium/TestRunner/src/MockWebRTCPeerConnectionHandler.cpp: 11 (WebTestRunner::MockWebRTCPeerConnectionHandler::addStream): 12 (WebTestRunner::MockWebRTCPeerConnectionHandler::removeStream): 13 * DumpRenderTree/chromium/TestRunner/src/WebUserMediaClientMock.cpp: 14 (WebTestRunner::WebUserMediaClientMock::requestUserMedia): 15 1 16 2013-03-05 Jochen Eisinger <jochen@chromium.org> 2 17 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/MockWebRTCPeerConnectionHandler.cpp
r142790 r144748 256 256 bool MockWebRTCPeerConnectionHandler::addStream(const WebMediaStream& stream, const WebMediaConstraints&) 257 257 { 258 m_streamCount += 1; 259 m_client->didAddRemoteStream(stream); 258 ++m_streamCount; 260 259 m_client->negotiationNeeded(); 261 260 return true; … … 264 263 void MockWebRTCPeerConnectionHandler::removeStream(const WebMediaStream& stream) 265 264 { 266 m_streamCount -= 1; 267 m_client->didRemoveRemoteStream(stream); 265 --m_streamCount; 268 266 m_client->negotiationNeeded(); 269 267 } -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/WebUserMediaClientMock.cpp
r142790 r144748 122 122 123 123 WebMediaStream stream; 124 stream.initialize( "foobar",audioTracks, videoTracks);124 stream.initialize(audioTracks, videoTracks); 125 125 126 126 stream.setExtraData(new MockExtraData());
Note: See TracChangeset
for help on using the changeset viewer.