OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "content/renderer/media/media_stream_dependency_factory.h" | 12 #include "content/renderer/media/media_stream_dependency_factory.h" |
13 | 13 |
14 namespace webrtc { | 14 namespace webrtc { |
15 | 15 |
16 class MockLocalVideoTrack : public LocalVideoTrackInterface { | 16 class MockLocalVideoTrack : public LocalVideoTrackInterface { |
17 public: | 17 public: |
18 explicit MockLocalVideoTrack(std::string label) | 18 explicit MockLocalVideoTrack(std::string label) |
19 : enabled_(false), | 19 : enabled_(false), |
20 label_(label), | 20 label_(label) { |
21 renderer_(NULL) { | |
22 } | 21 } |
23 virtual cricket::VideoCapturer* GetVideoCapture() OVERRIDE; | 22 virtual cricket::VideoCapturer* GetVideoCapture() OVERRIDE; |
24 virtual void SetRenderer(VideoRendererWrapperInterface* renderer) OVERRIDE; | |
25 virtual VideoRendererWrapperInterface* GetRenderer() OVERRIDE; | |
26 virtual void AddRenderer(VideoRendererInterface* renderer) OVERRIDE; | 23 virtual void AddRenderer(VideoRendererInterface* renderer) OVERRIDE; |
27 virtual void RemoveRenderer(VideoRendererInterface* renderer) OVERRIDE; | 24 virtual void RemoveRenderer(VideoRendererInterface* renderer) OVERRIDE; |
28 virtual cricket::VideoRenderer* FrameInput() OVERRIDE; | 25 virtual cricket::VideoRenderer* FrameInput() OVERRIDE; |
29 virtual std::string kind() const OVERRIDE; | 26 virtual std::string kind() const OVERRIDE; |
30 virtual std::string label() const OVERRIDE; | 27 virtual std::string label() const OVERRIDE; |
31 virtual bool enabled() const OVERRIDE; | 28 virtual bool enabled() const OVERRIDE; |
32 virtual TrackState state() const OVERRIDE; | 29 virtual TrackState state() const OVERRIDE; |
33 virtual bool set_enabled(bool enable) OVERRIDE; | 30 virtual bool set_enabled(bool enable) OVERRIDE; |
34 virtual bool set_state(TrackState new_state) OVERRIDE; | 31 virtual bool set_state(TrackState new_state) OVERRIDE; |
35 virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; | 32 virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; |
36 virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; | 33 virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; |
37 | 34 |
38 protected: | 35 protected: |
39 virtual ~MockLocalVideoTrack() {} | 36 virtual ~MockLocalVideoTrack() {} |
40 | 37 |
41 private: | 38 private: |
42 bool enabled_; | 39 bool enabled_; |
43 std::string label_; | 40 std::string label_; |
44 VideoRendererWrapperInterface* renderer_; | |
45 }; | 41 }; |
46 | 42 |
47 class MockLocalAudioTrack : public LocalAudioTrackInterface { | 43 class MockLocalAudioTrack : public LocalAudioTrackInterface { |
48 public: | 44 public: |
49 explicit MockLocalAudioTrack(const std::string& label) | 45 explicit MockLocalAudioTrack(const std::string& label) |
50 : enabled_(false), | 46 : enabled_(false), |
51 label_(label) { | 47 label_(label) { |
52 } | 48 } |
53 virtual AudioDeviceModule* GetAudioDevice() OVERRIDE; | 49 virtual AudioDeviceModule* GetAudioDevice() OVERRIDE; |
54 virtual std::string kind() const OVERRIDE; | 50 virtual std::string kind() const OVERRIDE; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 int sdp_mline_index, | 101 int sdp_mline_index, |
106 const std::string& sdp) OVERRIDE; | 102 const std::string& sdp) OVERRIDE; |
107 | 103 |
108 private: | 104 private: |
109 bool mock_pc_factory_created_; | 105 bool mock_pc_factory_created_; |
110 | 106 |
111 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); | 107 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); |
112 }; | 108 }; |
113 | 109 |
114 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 110 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |