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