OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include <string> |
| 6 |
| 7 #include "content/public/renderer/media_stream_video_sink.h" |
| 8 #include "content/renderer/media/media_stream_video_source.h" |
| 9 #include "media/base/video_frame.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 class MediaStreamVideoSourceTest : public ::testing::Test { |
| 15 public: |
| 16 MediaStreamVideoSourceTest() { |
| 17 } |
| 18 |
| 19 protected: |
| 20 MediaStreamVideoSource source_; |
| 21 }; |
| 22 |
| 23 TEST_F(MediaStreamVideoSourceTest, OnVideoFrame) { |
| 24 blink::WebMediaConstraints constrains; |
| 25 blink::WebMediaStreamTrack track; |
| 26 source_.AddTrack(track, constrains); |
| 27 const int kWidth = 640; |
| 28 const int kHeight = 480; |
| 29 scoped_refptr<media::VideoFrame> frame = |
| 30 media::VideoFrame::CreateBlackFrame(gfx::Size(kWidth, kHeight)); |
| 31 ASSERT_TRUE(frame.get()); |
| 32 source_.PutVideoFrame(frame); |
| 33 source_.RemoveTrack(track); |
| 34 } |
| 35 |
| 36 } // namespace content |
OLD | NEW |