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/public/renderer/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 TestTrack : public MediaStreamVideoSink { |
| 15 public: |
| 16 virtual void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame) {} |
| 17 }; |
| 18 |
| 19 class MediaStreamVideoSourceTest |
| 20 : public ::testing::Test, |
| 21 public MediaStreamVideoSource { |
| 22 public: |
| 23 MediaStreamVideoSourceTest() { |
| 24 } |
| 25 }; |
| 26 |
| 27 TEST_F(MediaStreamVideoSourceTest, OnVideoFrame) { |
| 28 blink::WebMediaConstraints constrains; |
| 29 TestTrack track; |
| 30 EXPECT_TRUE(Register(&track, constrains)); |
| 31 const int kWidth = 640; |
| 32 const int kHeight = 480; |
| 33 scoped_refptr<media::VideoFrame> frame = |
| 34 media::VideoFrame::CreateBlackFrame(gfx::Size(kWidth, kHeight)); |
| 35 ASSERT_TRUE(frame.get()); |
| 36 OnVideoFrame(frame); |
| 37 EXPECT_TRUE(Unregister(&track)); |
| 38 } |
| 39 |
| 40 } // namespace content |
OLD | NEW |