OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/child/child_process.h" | 9 #include "content/child/child_process.h" |
10 #include "content/renderer/media/media_stream_video_renderer_sink.h" | 10 #include "content/renderer/media/media_stream_video_renderer_sink.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 closure.Run(); | 31 closure.Run(); |
32 } | 32 } |
33 | 33 |
34 class MediaStreamVideoRendererSinkTest : public testing::Test { | 34 class MediaStreamVideoRendererSinkTest : public testing::Test { |
35 public: | 35 public: |
36 MediaStreamVideoRendererSinkTest() | 36 MediaStreamVideoRendererSinkTest() |
37 : child_process_(new ChildProcess()), | 37 : child_process_(new ChildProcess()), |
38 mock_source_(new MockMediaStreamVideoSource(false)) { | 38 mock_source_(new MockMediaStreamVideoSource(false)) { |
39 blink_source_.initialize(blink::WebString::fromASCII("dummy_source_id"), | 39 blink_source_.initialize(blink::WebString::fromASCII("dummy_source_id"), |
40 blink::WebMediaStreamSource::TypeVideo, | 40 blink::WebMediaStreamSource::TypeVideo, |
41 blink::WebString::fromASCII("dummy_source_name")); | 41 blink::WebString::fromASCII("dummy_source_name"), |
| 42 false /* remote */); |
42 blink_source_.setExtraData(mock_source_); | 43 blink_source_.setExtraData(mock_source_); |
43 blink::WebMediaConstraints constraints; | 44 blink::WebMediaConstraints constraints; |
44 constraints.initialize(); | 45 constraints.initialize(); |
45 blink_track_ = MediaStreamVideoTrack::CreateVideoTrack( | 46 blink_track_ = MediaStreamVideoTrack::CreateVideoTrack( |
46 mock_source_, constraints, MediaStreamSource::ConstraintsCallback(), | 47 mock_source_, constraints, MediaStreamSource::ConstraintsCallback(), |
47 true); | 48 true); |
48 mock_source_->StartMockedSource(); | 49 mock_source_->StartMockedSource(); |
49 base::RunLoop().RunUntilIdle(); | 50 base::RunLoop().RunUntilIdle(); |
50 | 51 |
51 media_stream_video_renderer_sink_ = new MediaStreamVideoRendererSink( | 52 media_stream_video_renderer_sink_ = new MediaStreamVideoRendererSink( |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 const scoped_refptr<media::VideoFrame> video_frame = | 221 const scoped_refptr<media::VideoFrame> video_frame = |
221 media::VideoFrame::CreateFrame(media::PIXEL_FORMAT_YV12A, kSize, | 222 media::VideoFrame::CreateFrame(media::PIXEL_FORMAT_YV12A, kSize, |
222 gfx::Rect(kSize), kSize, kTimestamp); | 223 gfx::Rect(kSize), kSize, kTimestamp); |
223 OnVideoFrame(video_frame); | 224 OnVideoFrame(video_frame); |
224 base::RunLoop().RunUntilIdle(); | 225 base::RunLoop().RunUntilIdle(); |
225 | 226 |
226 media_stream_video_renderer_sink_->Stop(); | 227 media_stream_video_renderer_sink_->Stop(); |
227 } | 228 } |
228 | 229 |
229 } // namespace content | 230 } // namespace content |
OLD | NEW |