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

Unified Diff: content/renderer/media/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/renderer/media/media_stream_video_source_unittest.cc
===================================================================
--- content/renderer/media/media_stream_video_source_unittest.cc (revision 0)
+++ content/renderer/media/media_stream_video_source_unittest.cc (revision 0)
@@ -0,0 +1,37 @@
+// 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/renderer/media/media_stream_video_source.h"
+#include "media/base/video_frame.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace content {
+
+class MediaStreamVideoSourceTest : public ::testing::Test {
+ public:
+ MediaStreamVideoSourceTest() {
+ }
+
+ protected:
+ MediaStreamVideoSource source_;
+};
+
+TEST_F(MediaStreamVideoSourceTest, OnVideoFrame) {
+ blink::WebMediaConstraints constraints;
+ blink::WebMediaStreamTrack track;
+ source_.AddTrack(track, constraints);
+ source_.SetReadyState(blink::WebMediaStreamSource::ReadyStateLive);
+ const int kWidth = 640;
+ const int kHeight = 480;
+ scoped_refptr<media::VideoFrame> frame =
+ media::VideoFrame::CreateBlackFrame(gfx::Size(kWidth, kHeight));
+ ASSERT_TRUE(frame.get());
+ source_.PutVideoFrame(frame);
+ source_.SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded);
+ source_.RemoveTrack(track);
+}
+
+} // namespace content
Property changes on: content/renderer/media/media_stream_video_source_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698