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 } | 21 } |
22 virtual cricket::VideoCapturer* GetVideoCapture() OVERRIDE; | |
23 virtual void AddRenderer(VideoRendererInterface* renderer) OVERRIDE; | 22 virtual void AddRenderer(VideoRendererInterface* renderer) OVERRIDE; |
24 virtual void RemoveRenderer(VideoRendererInterface* renderer) OVERRIDE; | 23 virtual void RemoveRenderer(VideoRendererInterface* renderer) OVERRIDE; |
25 virtual cricket::VideoRenderer* FrameInput() OVERRIDE; | 24 virtual cricket::VideoRenderer* FrameInput() OVERRIDE; |
26 virtual std::string kind() const OVERRIDE; | 25 virtual std::string kind() const OVERRIDE; |
27 virtual std::string label() const OVERRIDE; | 26 virtual std::string label() const OVERRIDE; |
28 virtual bool enabled() const OVERRIDE; | 27 virtual bool enabled() const OVERRIDE; |
29 virtual TrackState state() const OVERRIDE; | 28 virtual TrackState state() const OVERRIDE; |
30 virtual bool set_enabled(bool enable) OVERRIDE; | 29 virtual bool set_enabled(bool enable) OVERRIDE; |
31 virtual bool set_state(TrackState new_state) OVERRIDE; | 30 virtual bool set_state(TrackState new_state) OVERRIDE; |
32 virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; | 31 virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; |
33 virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; | 32 virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; |
| 33 virtual VideoSourceInterface* GetSource() const OVERRIDE; |
34 | 34 |
35 protected: | 35 protected: |
36 virtual ~MockLocalVideoTrack() {} | 36 virtual ~MockLocalVideoTrack() {} |
37 | 37 |
38 private: | 38 private: |
39 bool enabled_; | 39 bool enabled_; |
40 std::string label_; | 40 std::string label_; |
41 }; | 41 }; |
42 | 42 |
43 class MockLocalAudioTrack : public LocalAudioTrackInterface { | 43 class MockLocalAudioTrack : public LocalAudioTrackInterface { |
44 public: | 44 public: |
45 explicit MockLocalAudioTrack(const std::string& label) | 45 explicit MockLocalAudioTrack(const std::string& label) |
46 : enabled_(false), | 46 : enabled_(false), |
47 label_(label) { | 47 label_(label) { |
48 } | 48 } |
49 virtual AudioDeviceModule* GetAudioDevice() OVERRIDE; | |
50 virtual std::string kind() const OVERRIDE; | 49 virtual std::string kind() const OVERRIDE; |
51 virtual std::string label() const OVERRIDE; | 50 virtual std::string label() const OVERRIDE; |
52 virtual bool enabled() const OVERRIDE; | 51 virtual bool enabled() const OVERRIDE; |
53 virtual TrackState state() const OVERRIDE; | 52 virtual TrackState state() const OVERRIDE; |
54 virtual bool set_enabled(bool enable) OVERRIDE; | 53 virtual bool set_enabled(bool enable) OVERRIDE; |
55 virtual bool set_state(TrackState new_state) OVERRIDE; | 54 virtual bool set_state(TrackState new_state) OVERRIDE; |
56 virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; | 55 virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE; |
57 virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; | 56 virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE; |
| 57 virtual AudioSourceInterface* GetSource() const OVERRIDE; |
58 | 58 |
59 protected: | 59 protected: |
60 virtual ~MockLocalAudioTrack() {} | 60 virtual ~MockLocalAudioTrack() {} |
61 | 61 |
62 private: | 62 private: |
63 bool enabled_; | 63 bool enabled_; |
64 std::string label_; | 64 std::string label_; |
65 }; | 65 }; |
66 | 66 |
67 } // namespace webrtc | 67 } // namespace webrtc |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 virtual bool EnsurePeerConnectionFactory() OVERRIDE; | 102 virtual bool EnsurePeerConnectionFactory() OVERRIDE; |
103 virtual void SetAudioDeviceSessionId(int session_id) OVERRIDE; | 103 virtual void SetAudioDeviceSessionId(int session_id) OVERRIDE; |
104 | 104 |
105 private: | 105 private: |
106 bool mock_pc_factory_created_; | 106 bool mock_pc_factory_created_; |
107 | 107 |
108 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); | 108 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); |
109 }; | 109 }; |
110 | 110 |
111 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 111 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |