Index: content/renderer/media/mock_media_stream_dependency_factory.h |
diff --git a/content/renderer/media/mock_media_stream_dependency_factory.h b/content/renderer/media/mock_media_stream_dependency_factory.h |
index 163baabc4401c62990cf6fa2fd20b97ba3cebbe3..00c797f1ca1143aa5d0973351ff3d6a12e06c391 100644 |
--- a/content/renderer/media/mock_media_stream_dependency_factory.h |
+++ b/content/renderer/media/mock_media_stream_dependency_factory.h |
@@ -5,33 +5,77 @@ |
#ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
#define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
+#include <string> |
+#include <vector> |
+ |
#include "base/compiler_specific.h" |
#include "content/renderer/media/media_stream_dependency_factory.h" |
+namespace webrtc { |
+ |
+class MockLocalVideoTrack : public LocalVideoTrackInterface { |
+ public: |
+ explicit MockLocalVideoTrack(std::string label) |
+ : enabled_(false), |
+ label_(label), |
+ renderer_(NULL) { |
+ } |
+ virtual cricket::VideoCapturer* GetVideoCapture() OVERRIDE; |
+ virtual void SetRenderer(VideoRendererWrapperInterface* renderer) OVERRIDE; |
+ virtual VideoRendererWrapperInterface* GetRenderer() OVERRIDE; |
+ virtual std::string kind() const OVERRIDE; |
+ virtual std::string label() const OVERRIDE; |
+ virtual bool enabled() const OVERRIDE; |
+ virtual TrackState state() const OVERRIDE; |
+ virtual bool set_enabled(bool enable) OVERRIDE; |
+ virtual bool set_state(TrackState new_state) OVERRIDE; |
+ virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; |
+ virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; |
+ |
+ VideoRendererWrapperInterface* renderer() const { return renderer_; } |
+ |
+ protected: |
+ virtual ~MockLocalVideoTrack() {} |
+ |
+ private: |
+ bool enabled_; |
+ std::string label_; |
+ VideoRendererWrapperInterface* renderer_; |
+}; |
+ |
+} // namespace webrtc |
+ |
// A mock factory for creating different objects for MediaStreamImpl. |
class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory { |
public: |
MockMediaStreamDependencyFactory(); |
virtual ~MockMediaStreamDependencyFactory(); |
- virtual cricket::WebRtcMediaEngine* CreateWebRtcMediaEngine() OVERRIDE; |
virtual bool CreatePeerConnectionFactory( |
- cricket::MediaEngineInterface* media_engine, |
- talk_base::Thread* worker_thread) OVERRIDE; |
- virtual void DeletePeerConnectionFactory() OVERRIDE; |
- virtual bool PeerConnectionFactoryCreated() OVERRIDE; |
- virtual cricket::PortAllocator* CreatePortAllocator( |
+ talk_base::Thread* worker_thread, |
+ talk_base::Thread* signaling_thread, |
content::P2PSocketDispatcher* socket_dispatcher, |
talk_base::NetworkManager* network_manager, |
- talk_base::PacketSocketFactory* socket_factory, |
- const webkit_glue::P2PTransport::Config& config) OVERRIDE; |
- virtual webrtc::PeerConnection* CreatePeerConnection( |
- cricket::PortAllocator* port_allocator, |
- talk_base::Thread* signaling_thread) OVERRIDE; |
+ talk_base::PacketSocketFactory* socket_factory) OVERRIDE; |
+ virtual void ReleasePeerConnectionFactory() OVERRIDE; |
+ virtual bool PeerConnectionFactoryCreated() OVERRIDE; |
+ virtual talk_base::scoped_refptr<webrtc::PeerConnectionInterface> |
+ CreatePeerConnection( |
+ const std::string& config, |
+ webrtc::PeerConnectionObserver* observer) OVERRIDE; |
+ virtual talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface> |
+ CreateLocalMediaStream(const std::string& label) OVERRIDE; |
+ virtual talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface> |
+ CreateLocalVideoTrack( |
+ const std::string& label, |
+ cricket::VideoCapturer* video_device) OVERRIDE; |
+ virtual talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface> |
+ CreateLocalAudioTrack( |
+ const std::string& label, |
+ webrtc::AudioDeviceModule* audio_device) OVERRIDE; |
private: |
bool mock_pc_factory_created_; |
- scoped_ptr<cricket::MediaEngineInterface> media_engine_; |
DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); |
}; |