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

Side by Side Diff: content/renderer/media/media_stream_video_source_unittest.cc

Issue 332863002: Video Capture: Allow 0 fps frame rates to be deserializable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Back to allowing 0 fps to be (de)serialized. Added test to MSVS. Created 6 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/video/capture/video_capture_types.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 MediaStreamVideoSource::kMinHeight)); 655 MediaStreamVideoSource::kMinHeight));
656 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( 656 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported(
657 MediaStreamVideoSource::kMaxAspectRatio)); 657 MediaStreamVideoSource::kMaxAspectRatio));
658 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( 658 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported(
659 MediaStreamVideoSource::kMinAspectRatio)); 659 MediaStreamVideoSource::kMinAspectRatio));
660 660
661 EXPECT_FALSE(MediaStreamVideoSource::IsConstraintSupported( 661 EXPECT_FALSE(MediaStreamVideoSource::IsConstraintSupported(
662 "something unsupported")); 662 "something unsupported"));
663 } 663 }
664 664
665 // Test that the constraint negotiation can handle 0.0 fps as frame rate.
666 TEST_F(MediaStreamVideoSourceTest, Use0FpsSupportedFormat) {
667 media::VideoCaptureFormats formats;
668 formats.push_back(media::VideoCaptureFormat(
669 gfx::Size(640, 480), 0.0f, media::PIXEL_FORMAT_I420));
670 formats.push_back(media::VideoCaptureFormat(
671 gfx::Size(320, 240), 0.0f, media::PIXEL_FORMAT_I420));
672 mock_source()->SetSupportedFormats(formats);
673
674 blink::WebMediaConstraints constraints;
675 constraints.initialize();
676 blink::WebMediaStreamTrack track = CreateTrack("123", constraints);
677 mock_source()->CompleteGetSupportedFormats();
678 mock_source()->StartMockedSource();
679 EXPECT_EQ(1, NumberOfSuccessConstraintsCallbacks());
perkj_chrome 2014/06/19 12:26:14 Please also deliver a frame to a sink. See line 61
680 }
681
665 } // namespace content 682 } // namespace content
OLDNEW
« 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