| 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 #include "content/renderer/media/mock_media_stream_registry.h" | 5 #include "content/renderer/media/mock_media_stream_registry.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/renderer/media/media_stream.h" | 10 #include "content/renderer/media/media_stream.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 MockMediaStreamRegistry::MockMediaStreamRegistry() { | 22 MockMediaStreamRegistry::MockMediaStreamRegistry() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 void MockMediaStreamRegistry::Init(const std::string& stream_url) { | 25 void MockMediaStreamRegistry::Init(const std::string& stream_url) { |
| 26 stream_url_ = stream_url; | 26 stream_url_ = stream_url; |
| 27 blink::WebVector<blink::WebMediaStreamTrack> webkit_audio_tracks; | 27 blink::WebVector<blink::WebMediaStreamTrack> webkit_audio_tracks; |
| 28 blink::WebVector<blink::WebMediaStreamTrack> webkit_video_tracks; | 28 blink::WebVector<blink::WebMediaStreamTrack> webkit_video_tracks; |
| 29 blink::WebString label(kTestStreamLabel); | 29 blink::WebString label(kTestStreamLabel); |
| 30 test_stream_.initialize(label, webkit_audio_tracks, webkit_video_tracks); | 30 test_stream_.initialize(label, webkit_audio_tracks, webkit_video_tracks); |
| 31 test_stream_.setExtraData(new MediaStream(&dependency_factory_, | 31 test_stream_.setExtraData(new MediaStream(&dependency_factory_, |
| 32 MediaStream::StreamStopCallback(), | |
| 33 test_stream_)); | 32 test_stream_)); |
| 34 } | 33 } |
| 35 | 34 |
| 36 void MockMediaStreamRegistry::AddVideoTrack(const std::string& track_id) { | 35 void MockMediaStreamRegistry::AddVideoTrack(const std::string& track_id) { |
| 37 blink::WebMediaStreamSource blink_source; | 36 blink::WebMediaStreamSource blink_source; |
| 38 blink_source.initialize("mock video source id", | 37 blink_source.initialize("mock video source id", |
| 39 blink::WebMediaStreamSource::TypeVideo, | 38 blink::WebMediaStreamSource::TypeVideo, |
| 40 "mock video source name"); | 39 "mock video source name"); |
| 41 MockMediaStreamVideoSource* native_source = | 40 MockMediaStreamVideoSource* native_source = |
| 42 new MockMediaStreamVideoSource(&dependency_factory_, false); | 41 new MockMediaStreamVideoSource(&dependency_factory_, false); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 return blink::WebMediaStream(); | 61 return blink::WebMediaStream(); |
| 63 } | 62 } |
| 64 return test_stream_; | 63 return test_stream_; |
| 65 } | 64 } |
| 66 | 65 |
| 67 const blink::WebMediaStream MockMediaStreamRegistry::test_stream() const { | 66 const blink::WebMediaStream MockMediaStreamRegistry::test_stream() const { |
| 68 return test_stream_; | 67 return test_stream_; |
| 69 } | 68 } |
| 70 | 69 |
| 71 } // namespace content | 70 } // namespace content |
| OLD | NEW |