Index: content/public/renderer/media_stream_video_source_unittest.cc |
=================================================================== |
--- content/public/renderer/media_stream_video_source_unittest.cc (revision 0) |
+++ content/public/renderer/media_stream_video_source_unittest.cc (revision 0) |
@@ -0,0 +1,40 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include <string> |
+ |
+#include "content/public/renderer/media_stream_video_sink.h" |
+#include "content/public/renderer/media_stream_video_source.h" |
+#include "media/base/video_frame.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+ |
+namespace content { |
+ |
+class TestTrack : public MediaStreamVideoSink { |
+ public: |
+ virtual void OnVideoFrame(const scoped_refptr<media::VideoFrame>& frame) {} |
+}; |
+ |
+class MediaStreamVideoSourceTest |
+ : public ::testing::Test, |
+ public MediaStreamVideoSource { |
+ public: |
+ MediaStreamVideoSourceTest() { |
+ } |
+}; |
+ |
+TEST_F(MediaStreamVideoSourceTest, OnVideoFrame) { |
+ blink::WebMediaConstraints constrains; |
+ TestTrack track; |
+ EXPECT_TRUE(Register(&track, constrains)); |
+ const int kWidth = 640; |
+ const int kHeight = 480; |
+ scoped_refptr<media::VideoFrame> frame = |
+ media::VideoFrame::CreateBlackFrame(gfx::Size(kWidth, kHeight)); |
+ ASSERT_TRUE(frame.get()); |
+ OnVideoFrame(frame); |
+ EXPECT_TRUE(Unregister(&track)); |
+} |
+ |
+} // namespace content |
Property changes on: content/public/renderer/media_stream_video_source_unittest.cc |
___________________________________________________________________ |
Added: svn:eol-style |
+ LF |