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 |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // Changes the state of the source to live and notifies the observer. | 29 // Changes the state of the source to live and notifies the observer. |
30 void SetLive(); | 30 void SetLive(); |
31 // Changes the state of the source to ended and notifies the observer. | 31 // Changes the state of the source to ended and notifies the observer. |
32 void SetEnded(); | 32 void SetEnded(); |
33 | 33 |
34 protected: | 34 protected: |
35 virtual ~MockVideoSource(); | 35 virtual ~MockVideoSource(); |
36 | 36 |
37 private: | 37 private: |
38 webrtc::ObserverInterface* observer_; | 38 void FireOnChanged(); |
| 39 |
| 40 std::vector<webrtc::ObserverInterface*> observers_; |
39 MediaSourceInterface::SourceState state_; | 41 MediaSourceInterface::SourceState state_; |
40 }; | 42 }; |
41 | 43 |
42 class MockAudioSource : public webrtc::AudioSourceInterface { | 44 class MockAudioSource : public webrtc::AudioSourceInterface { |
43 public: | 45 public: |
44 explicit MockAudioSource( | 46 explicit MockAudioSource( |
45 const webrtc::MediaConstraintsInterface* constraints); | 47 const webrtc::MediaConstraintsInterface* constraints); |
46 | 48 |
47 virtual void RegisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; | 49 virtual void RegisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; |
48 virtual void UnregisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; | 50 virtual void UnregisterObserver(webrtc::ObserverInterface* observer) OVERRIDE; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 bool mock_pc_factory_created_; | 182 bool mock_pc_factory_created_; |
181 scoped_refptr <MockAudioSource> last_audio_source_; | 183 scoped_refptr <MockAudioSource> last_audio_source_; |
182 scoped_refptr <MockVideoSource> last_video_source_; | 184 scoped_refptr <MockVideoSource> last_video_source_; |
183 | 185 |
184 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); | 186 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); |
185 }; | 187 }; |
186 | 188 |
187 } // namespace content | 189 } // namespace content |
188 | 190 |
189 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ | 191 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ |
OLD | NEW |