| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "content/renderer/media/media_stream_constraints_util_video_device.h" | 5 #include "content/renderer/media/media_stream_constraints_util_video_device.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/optional.h" | 10 #include "base/optional.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 constraint_factory_.Reset(); | 241 constraint_factory_.Reset(); |
| 242 constraint_factory_.basic().aspectRatio.setMin(123467890.0); | 242 constraint_factory_.basic().aspectRatio.setMin(123467890.0); |
| 243 result = SelectSettings(); | 243 result = SelectSettings(); |
| 244 EXPECT_FALSE(result.HasValue()); | 244 EXPECT_FALSE(result.HasValue()); |
| 245 EXPECT_EQ(constraint_factory_.basic().aspectRatio.name(), | 245 EXPECT_EQ(constraint_factory_.basic().aspectRatio.name(), |
| 246 result.failed_constraint_name()); | 246 result.failed_constraint_name()); |
| 247 | 247 |
| 248 constraint_factory_.Reset(); | 248 constraint_factory_.Reset(); |
| 249 // This value is lower than the minimum supported by sources. | 249 // This value is lower than the minimum supported by sources. |
| 250 double kLowAspectRatio = 0.01; | 250 const double kLowAspectRatio = 0.01; |
| 251 constraint_factory_.basic().aspectRatio.setMax(kLowAspectRatio); | 251 constraint_factory_.basic().aspectRatio.setMax(kLowAspectRatio); |
| 252 result = SelectSettings(); | 252 result = SelectSettings(); |
| 253 EXPECT_FALSE(result.HasValue()); | 253 EXPECT_FALSE(result.HasValue()); |
| 254 EXPECT_EQ(constraint_factory_.basic().aspectRatio.name(), | 254 EXPECT_EQ(constraint_factory_.basic().aspectRatio.name(), |
| 255 result.failed_constraint_name()); | 255 result.failed_constraint_name()); |
| 256 } | 256 } |
| 257 | 257 |
| 258 TEST_F(MediaStreamConstraintsUtilVideoDeviceTest, OverconstrainedOnFrameRate) { | 258 TEST_F(MediaStreamConstraintsUtilVideoDeviceTest, OverconstrainedOnFrameRate) { |
| 259 constraint_factory_.Reset(); | 259 constraint_factory_.Reset(); |
| 260 constraint_factory_.basic().frameRate.setExact(123467890.0); | 260 constraint_factory_.basic().frameRate.setExact(123467890.0); |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 constraint_factory_.Reset(); | 1680 constraint_factory_.Reset(); |
| 1681 constraint_factory_.basic().height.setExact(100); | 1681 constraint_factory_.basic().height.setExact(100); |
| 1682 VideoDeviceCaptureCapabilities capabilities; | 1682 VideoDeviceCaptureCapabilities capabilities; |
| 1683 auto result = SelectVideoDeviceCaptureSourceSettings( | 1683 auto result = SelectVideoDeviceCaptureSourceSettings( |
| 1684 capabilities, constraint_factory_.CreateWebMediaConstraints()); | 1684 capabilities, constraint_factory_.CreateWebMediaConstraints()); |
| 1685 EXPECT_FALSE(result.HasValue()); | 1685 EXPECT_FALSE(result.HasValue()); |
| 1686 EXPECT_TRUE(std::string(result.failed_constraint_name()).empty()); | 1686 EXPECT_TRUE(std::string(result.failed_constraint_name()).empty()); |
| 1687 } | 1687 } |
| 1688 | 1688 |
| 1689 } // namespace content | 1689 } // namespace content |
| OLD | NEW |