Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: webrtc/api/videocapturertracksource_unittest.cc

Issue 2334683002: Add method cricket::VideoCapturer::NeedsDenoising, use in VideoCapturerTrackSource. (Closed)
Patch Set: Address pbos' comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/videocapturertracksource_unittest.cc
diff --git a/webrtc/api/videocapturertracksource_unittest.cc b/webrtc/api/videocapturertracksource_unittest.cc
index 607188c0448b266ff15e623482637d3ffa0806e1..48133b1736c538928ac9f1f8d79e6f30f7b120fd 100644
--- a/webrtc/api/videocapturertracksource_unittest.cc
+++ b/webrtc/api/videocapturertracksource_unittest.cc
@@ -444,6 +444,35 @@ TEST_F(VideoCapturerTrackSourceTest, ScreencastResolutionWithConstraint) {
EXPECT_EQ(30, format->framerate());
}
+TEST_F(VideoCapturerTrackSourceTest, DenoisingDefault) {
+ CreateVideoCapturerSource();
+ EXPECT_FALSE(source_->needs_denoising());
+}
+
+TEST_F(VideoCapturerTrackSourceTest, DenoisingConstraintOn) {
+ FakeConstraints constraints;
+ constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true);
+ CreateVideoCapturerSource(&constraints);
+ ASSERT_TRUE(source_->needs_denoising());
+ EXPECT_TRUE(*source_->needs_denoising());
+}
+
+TEST_F(VideoCapturerTrackSourceTest, DenoisingCapturerOff) {
+ capturer_->SetNeedsDenoising(rtc::Optional<bool>(false));
+ CreateVideoCapturerSource();
+ ASSERT_TRUE(source_->needs_denoising());
+ EXPECT_FALSE(*source_->needs_denoising());
+}
+
+TEST_F(VideoCapturerTrackSourceTest, DenoisingConstraintOverridesCapturer) {
+ capturer_->SetNeedsDenoising(rtc::Optional<bool>(false));
+ FakeConstraints constraints;
+ constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, true);
+ CreateVideoCapturerSource(&constraints);
+ ASSERT_TRUE(source_->needs_denoising());
+ EXPECT_TRUE(*source_->needs_denoising());
+}
+
TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) {
FakeConstraints constraints;
constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5);

Powered by Google App Engine
This is Rietveld 408576698