Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / renderer / media / mock_media_stream_registry.h
blob9c35b52ccf4d02210d521cb020e9db42c5327c91
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_
8 #include <string>
10 #include "content/renderer/media/media_stream_registry_interface.h"
12 namespace content {
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
16 // a mock.
17 class MockMediaStreamRegistry final : public MediaStreamRegistryInterface {
18 public:
19 MockMediaStreamRegistry();
21 void Init(const std::string& stream_url);
22 void AddVideoTrack(const std::string& track_id);
23 blink::WebMediaStream GetMediaStream(const std::string& url) override;
25 const blink::WebMediaStream test_stream() const { return test_stream_; }
27 private:
28 blink::WebMediaStream test_stream_;
29 std::string stream_url_;
32 } // namespace content
34 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_REGISTRY_H_