OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 ASSERT_TRUE(source_->is_screencast()); | 437 ASSERT_TRUE(source_->is_screencast()); |
438 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 438 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
439 kMaxWaitMs); | 439 kMaxWaitMs); |
440 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); | 440 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); |
441 ASSERT_TRUE(format != NULL); | 441 ASSERT_TRUE(format != NULL); |
442 EXPECT_EQ(480, format->width); | 442 EXPECT_EQ(480, format->width); |
443 EXPECT_EQ(270, format->height); | 443 EXPECT_EQ(270, format->height); |
444 EXPECT_EQ(30, format->framerate()); | 444 EXPECT_EQ(30, format->framerate()); |
445 } | 445 } |
446 | 446 |
| 447 TEST_F(VideoCapturerTrackSourceTest, DenoisingDefault) { |
| 448 CreateVideoCapturerSource(); |
| 449 EXPECT_FALSE(source_->needs_denoising()); |
| 450 } |
| 451 |
| 452 TEST_F(VideoCapturerTrackSourceTest, DenoisingConstraintOn) { |
| 453 FakeConstraints constraints; |
| 454 constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true); |
| 455 CreateVideoCapturerSource(&constraints); |
| 456 ASSERT_TRUE(source_->needs_denoising()); |
| 457 EXPECT_TRUE(*source_->needs_denoising()); |
| 458 } |
| 459 |
| 460 TEST_F(VideoCapturerTrackSourceTest, DenoisingCapturerOff) { |
| 461 capturer_->SetNeedsDenoising(rtc::Optional<bool>(false)); |
| 462 CreateVideoCapturerSource(); |
| 463 ASSERT_TRUE(source_->needs_denoising()); |
| 464 EXPECT_FALSE(*source_->needs_denoising()); |
| 465 } |
| 466 |
| 467 TEST_F(VideoCapturerTrackSourceTest, DenoisingConstraintOverridesCapturer) { |
| 468 capturer_->SetNeedsDenoising(rtc::Optional<bool>(false)); |
| 469 FakeConstraints constraints; |
| 470 constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true); |
| 471 CreateVideoCapturerSource(&constraints); |
| 472 ASSERT_TRUE(source_->needs_denoising()); |
| 473 EXPECT_TRUE(*source_->needs_denoising()); |
| 474 } |
| 475 |
447 TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) { | 476 TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) { |
448 FakeConstraints constraints; | 477 FakeConstraints constraints; |
449 constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5); | 478 constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
450 | 479 |
451 CreateVideoCapturerSource(&constraints); | 480 CreateVideoCapturerSource(&constraints); |
452 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), | 481 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
453 kMaxWaitMs); | 482 kMaxWaitMs); |
454 ASSERT_TRUE(capturer_->GetCaptureFormat() == NULL); | 483 ASSERT_TRUE(capturer_->GetCaptureFormat() == NULL); |
455 } | 484 } |
456 | 485 |
457 TEST_F(VideoCapturerTrackSourceTest, OptionalSubOneFpsConstraints) { | 486 TEST_F(VideoCapturerTrackSourceTest, OptionalSubOneFpsConstraints) { |
458 FakeConstraints constraints; | 487 FakeConstraints constraints; |
459 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); | 488 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
460 | 489 |
461 CreateVideoCapturerSource(&constraints); | 490 CreateVideoCapturerSource(&constraints); |
462 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 491 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
463 kMaxWaitMs); | 492 kMaxWaitMs); |
464 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); | 493 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); |
465 ASSERT_TRUE(format != NULL); | 494 ASSERT_TRUE(format != NULL); |
466 EXPECT_EQ(30, format->framerate()); | 495 EXPECT_EQ(30, format->framerate()); |
467 } | 496 } |
OLD | NEW |