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