Index: content/renderer/media/mock_media_stream_impl.cc |
diff --git a/content/renderer/media/mock_media_stream_impl.cc b/content/renderer/media/mock_media_stream_impl.cc |
index 910998952ea709bb35c6ac318aeac2010f6fab6d..0b2853584da19ea2686b845de896ea9d14c2a22f 100644 |
--- a/content/renderer/media/mock_media_stream_impl.cc |
+++ b/content/renderer/media/mock_media_stream_impl.cc |
@@ -4,6 +4,8 @@ |
#include "content/renderer/media/mock_media_stream_impl.h" |
+#include <utility> |
+ |
#include "content/renderer/media/rtc_video_decoder.h" |
MockMediaStreamImpl::MockMediaStreamImpl() |
@@ -20,12 +22,16 @@ MockMediaStreamImpl::CreatePeerConnectionHandler( |
} |
void MockMediaStreamImpl::ClosePeerConnection() { |
- video_label_.clear(); |
+ get_track_label_.clear(); |
} |
-bool MockMediaStreamImpl::SetVideoCaptureModule(const std::string& label) { |
- video_label_ = label; |
- return true; |
+webrtc::MediaStreamTrackInterface* |
+MockMediaStreamImpl::GetLocalMediaStreamTrack(std::string label) { |
+ MockMediaStreamTrackPtrMap::iterator it = mock_local_tracks_.find(label); |
+ if (it == mock_local_tracks_.end()) |
+ return NULL; |
+ webrtc::MediaStreamTrackInterface* stream = it->second; |
+ return stream; |
} |
scoped_refptr<media::VideoDecoder> MockMediaStreamImpl::GetVideoDecoder( |
@@ -58,3 +64,10 @@ void MockMediaStreamImpl::OnAudioDeviceFailed( |
int index) { |
NOTIMPLEMENTED(); |
} |
+ |
+void MockMediaStreamImpl::AddTrack( |
+ std::string label, |
+ webrtc::MediaStreamTrackInterface* track) { |
+ mock_local_tracks_.insert( |
+ std::pair<std::string, webrtc::MediaStreamTrackInterface*>(label, track)); |
+} |