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 | |
476 TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) { | 447 TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) { |
477 FakeConstraints constraints; | 448 FakeConstraints constraints; |
478 constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5); | 449 constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
479 | 450 |
480 CreateVideoCapturerSource(&constraints); | 451 CreateVideoCapturerSource(&constraints); |
481 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), | 452 EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), |
482 kMaxWaitMs); | 453 kMaxWaitMs); |
483 ASSERT_TRUE(capturer_->GetCaptureFormat() == NULL); | 454 ASSERT_TRUE(capturer_->GetCaptureFormat() == NULL); |
484 } | 455 } |
485 | 456 |
486 TEST_F(VideoCapturerTrackSourceTest, OptionalSubOneFpsConstraints) { | 457 TEST_F(VideoCapturerTrackSourceTest, OptionalSubOneFpsConstraints) { |
487 FakeConstraints constraints; | 458 FakeConstraints constraints; |
488 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); | 459 constraints.AddOptional(MediaConstraintsInterface::kMaxFrameRate, 0.5); |
489 | 460 |
490 CreateVideoCapturerSource(&constraints); | 461 CreateVideoCapturerSource(&constraints); |
491 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), | 462 EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), |
492 kMaxWaitMs); | 463 kMaxWaitMs); |
493 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); | 464 const cricket::VideoFormat* format = capturer_->GetCaptureFormat(); |
494 ASSERT_TRUE(format != NULL); | 465 ASSERT_TRUE(format != NULL); |
495 EXPECT_EQ(1, format->framerate()); | 466 EXPECT_EQ(1, format->framerate()); |
496 } | 467 } |
OLD | NEW |