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

Unified Diff: webrtc/api/videocapturertracksource_unittest.cc

Issue 2334683002: Add method cricket::VideoCapturer::NeedsDenoising, use in VideoCapturerTrackSource. (Closed)
Patch Set: Add tests for needs_denoising. 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..b65e84cf4aba6f74d9ec466c6edfb324ab3a7d4c 100644
--- a/webrtc/api/videocapturertracksource_unittest.cc
+++ b/webrtc/api/videocapturertracksource_unittest.cc
@@ -444,6 +444,26 @@ TEST_F(VideoCapturerTrackSourceTest, ScreencastResolutionWithConstraint) {
EXPECT_EQ(30, format->framerate());
}
+TEST_F(VideoCapturerTrackSourceTest, DenoisingDefault) {
+ CreateVideoCapturerSource();
+ EXPECT_FALSE(source_->needs_denoising());
+}
+
+TEST_F(VideoCapturerTrackSourceTest, DenoisingConstraintOn) {
pbos-webrtc 2016/09/13 14:02:09 I would like a test for constraints overriding the
nisse-webrtc 2016/09/13 14:24:05 Done.
+ 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(false);
+ CreateVideoCapturerSource();
+ ASSERT_TRUE(source_->needs_denoising());
+ EXPECT_FALSE(*source_->needs_denoising());
+}
+
TEST_F(VideoCapturerTrackSourceTest, MandatorySubOneFpsConstraints) {
FakeConstraints constraints;
constraints.AddMandatory(MediaConstraintsInterface::kMaxFrameRate, 0.5);

Powered by Google App Engine
This is Rietveld 408576698