| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 ACTION_P(RunClosure, closure) { | 30 ACTION_P(RunClosure, closure) { |
| 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(base::UTF8ToUTF16("dummy_source_id"), | 39 blink_source_.initialize(blink::WebString::fromASCII("dummy_source_id"), |
| 40 blink::WebMediaStreamSource::TypeVideo, | 40 blink::WebMediaStreamSource::TypeVideo, |
| 41 base::UTF8ToUTF16("dummy_source_name"), | 41 blink::WebString::fromASCII("dummy_source_name"), |
| 42 false /* remote */); | 42 false /* remote */); |
| 43 blink_source_.setExtraData(mock_source_); | 43 blink_source_.setExtraData(mock_source_); |
| 44 blink::WebMediaConstraints constraints; | 44 blink::WebMediaConstraints constraints; |
| 45 constraints.initialize(); | 45 constraints.initialize(); |
| 46 blink_track_ = MediaStreamVideoTrack::CreateVideoTrack( | 46 blink_track_ = MediaStreamVideoTrack::CreateVideoTrack( |
| 47 mock_source_, constraints, MediaStreamSource::ConstraintsCallback(), | 47 mock_source_, constraints, MediaStreamSource::ConstraintsCallback(), |
| 48 true); | 48 true); |
| 49 mock_source_->StartMockedSource(); | 49 mock_source_->StartMockedSource(); |
| 50 base::RunLoop().RunUntilIdle(); | 50 base::RunLoop().RunUntilIdle(); |
| 51 | 51 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 const scoped_refptr<media::VideoFrame> video_frame = | 221 const scoped_refptr<media::VideoFrame> video_frame = |
| 222 media::VideoFrame::CreateFrame(media::PIXEL_FORMAT_YV12A, kSize, | 222 media::VideoFrame::CreateFrame(media::PIXEL_FORMAT_YV12A, kSize, |
| 223 gfx::Rect(kSize), kSize, kTimestamp); | 223 gfx::Rect(kSize), kSize, kTimestamp); |
| 224 OnVideoFrame(video_frame); | 224 OnVideoFrame(video_frame); |
| 225 base::RunLoop().RunUntilIdle(); | 225 base::RunLoop().RunUntilIdle(); |
| 226 | 226 |
| 227 media_stream_video_renderer_sink_->Stop(); | 227 media_stream_video_renderer_sink_->Stop(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace content | 230 } // namespace content |
| OLD | NEW |