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

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

Issue 441033003: Merge 279078 "Video Capture: Allow 0 fps frame rates to be deser..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 4 months 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
« no previous file with comments | « no previous file | media/video/capture/video_capture_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_video_source_unittest.cc
===================================================================
--- content/renderer/media/media_stream_video_source_unittest.cc (revision 287597)
+++ content/renderer/media/media_stream_video_source_unittest.cc (working copy)
@@ -662,4 +662,33 @@
"something unsupported"));
}
+// Test that the constraint negotiation can handle 0.0 fps as frame rate.
+TEST_F(MediaStreamVideoSourceTest, Use0FpsSupportedFormat) {
+ media::VideoCaptureFormats formats;
+ formats.push_back(media::VideoCaptureFormat(
+ gfx::Size(640, 480), 0.0f, media::PIXEL_FORMAT_I420));
+ formats.push_back(media::VideoCaptureFormat(
+ gfx::Size(320, 240), 0.0f, media::PIXEL_FORMAT_I420));
+ mock_source()->SetSupportedFormats(formats);
+
+ blink::WebMediaConstraints constraints;
+ constraints.initialize();
+ blink::WebMediaStreamTrack track = CreateTrack("123", constraints);
+ mock_source()->CompleteGetSupportedFormats();
+ mock_source()->StartMockedSource();
+ EXPECT_EQ(1, NumberOfSuccessConstraintsCallbacks());
+
+ MockMediaStreamVideoSink sink;
+ MediaStreamVideoSink::AddToVideoTrack(
+ &sink, sink.GetDeliverFrameCB(), track);
+ EXPECT_EQ(0, sink.number_of_frames());
+ DeliverVideoFrameAndWaitForRenderer(320, 240, &sink);
+ EXPECT_EQ(1, sink.number_of_frames());
+ // Expect the delivered frame to be passed unchanged since its smaller than
+ // max requested.
+ EXPECT_EQ(320, sink.frame_size().width());
+ EXPECT_EQ(240, sink.frame_size().height());
+ MediaStreamVideoSink::RemoveFromVideoTrack(&sink, track);
+}
+
} // namespace content
« no previous file with comments | « no previous file | media/video/capture/video_capture_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698