OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_REGISTRY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ |
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ | 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "content/renderer/media/media_stream_registry_interface.h" | 10 #include "content/renderer/media/media_stream_registry_interface.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 // This class encapsulates creation of a Blink MediaStream having inside the | 14 // This class encapsulates creation of a Blink MediaStream having inside the |
15 // necessary Blink and Chromium, track and source. The Chrome Video source is | 15 // necessary Blink and Chromium, track and source. The Chrome Video source is |
16 // a mock. | 16 // a mock. |
17 class MockMediaStreamRegistry final : public MediaStreamRegistryInterface { | 17 class MockMediaStreamRegistry final : public MediaStreamRegistryInterface { |
18 public: | 18 public: |
19 MockMediaStreamRegistry(); | 19 MockMediaStreamRegistry(); |
20 | 20 |
21 void Init(const std::string& stream_url); | 21 void Init(const std::string& stream_url); |
22 void AddVideoTrack(const std::string& track_id); | 22 void AddVideoTrack(const std::string& track_id); |
| 23 void AddAudioTrack(const std::string& track_id); |
23 blink::WebMediaStream GetMediaStream(const std::string& url) override; | 24 blink::WebMediaStream GetMediaStream(const std::string& url) override; |
24 | 25 |
25 const blink::WebMediaStream test_stream() const { return test_stream_; } | 26 const blink::WebMediaStream test_stream() const { return test_stream_; } |
26 | 27 |
27 void reset() { | 28 void reset() { |
28 test_stream_.reset(); | 29 test_stream_.reset(); |
29 } | 30 } |
30 | 31 |
31 private: | 32 private: |
32 blink::WebMediaStream test_stream_; | 33 blink::WebMediaStream test_stream_; |
33 std::string stream_url_; | 34 std::string stream_url_; |
34 }; | 35 }; |
35 | 36 |
36 } // namespace content | 37 } // namespace content |
37 | 38 |
38 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ | 39 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_ |
OLD | NEW |