Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(723)

Unified Diff: content/public/renderer/media_stream_video_source_unittest.cc

Issue 99113003: Define the interface for MediaStreamVideoSource. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698