OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |