| 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/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/renderer/media/media_stream_video_source.h" | 10 #include "content/renderer/media/media_stream_video_source.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 TEST_F(MediaStreamVideoSourceTest, DeliverSmallerSizeWhenTooLargeMax) { | 376 TEST_F(MediaStreamVideoSourceTest, DeliverSmallerSizeWhenTooLargeMax) { |
| 377 MockMediaConstraintFactory factory; | 377 MockMediaConstraintFactory factory; |
| 378 factory.AddOptional(MediaStreamVideoSource::kMaxWidth, 1920); | 378 factory.AddOptional(MediaStreamVideoSource::kMaxWidth, 1920); |
| 379 factory.AddOptional(MediaStreamVideoSource::kMaxHeight, 1080); | 379 factory.AddOptional(MediaStreamVideoSource::kMaxHeight, 1080); |
| 380 factory.AddOptional(MediaStreamVideoSource::kMinWidth, 1280); | 380 factory.AddOptional(MediaStreamVideoSource::kMinWidth, 1280); |
| 381 factory.AddOptional(MediaStreamVideoSource::kMinHeight, 720); | 381 factory.AddOptional(MediaStreamVideoSource::kMinHeight, 720); |
| 382 TestSourceCropFrame(1280, 720, factory.CreateWebMediaConstraints(), | 382 TestSourceCropFrame(1280, 720, factory.CreateWebMediaConstraints(), |
| 383 1280, 720); | 383 1280, 720); |
| 384 } | 384 } |
| 385 | 385 |
| 386 TEST_F(MediaStreamVideoSourceTest, IsConstraintSupported) { |
| 387 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 388 MediaStreamVideoSource::kMaxFrameRate)); |
| 389 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 390 MediaStreamVideoSource::kMinFrameRate)); |
| 391 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 392 MediaStreamVideoSource::kMaxWidth)); |
| 393 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 394 MediaStreamVideoSource::kMinWidth)); |
| 395 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 396 MediaStreamVideoSource::kMaxHeight)); |
| 397 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 398 MediaStreamVideoSource::kMinHeight)); |
| 399 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 400 MediaStreamVideoSource::kMaxAspectRatio)); |
| 401 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( |
| 402 MediaStreamVideoSource::kMinAspectRatio)); |
| 403 |
| 404 EXPECT_FALSE(MediaStreamVideoSource::IsConstraintSupported( |
| 405 "googCpuAdaptation")); |
| 406 } |
| 407 |
| 386 } // namespace content | 408 } // namespace content |
| OLD | NEW |