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

Unified Diff: webrtc/api/videocapturertracksource_unittest.cc

Issue 1842073002: Change VideoSourceInterface::needs_denoising() to return rtc::Optional<bool> (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 9 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
« no previous file with comments | « webrtc/api/videocapturertracksource.cc ('k') | webrtc/api/videosourceproxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/videocapturertracksource_unittest.cc
diff --git a/webrtc/api/videocapturertracksource_unittest.cc b/webrtc/api/videocapturertracksource_unittest.cc
index 1a9d3ac5e18e6d6f2bc99faed728ee59776883e3..39252934ebf226ce134c4ba0fc9bf8f0aa4ae595 100644
--- a/webrtc/api/videocapturertracksource_unittest.cc
+++ b/webrtc/api/videocapturertracksource_unittest.cc
@@ -334,17 +334,17 @@ TEST_F(VideoCapturerTrackSourceTest, InvalidOptionalConstraint) {
TEST_F(VideoCapturerTrackSourceTest, SetValidDenoisingConstraint) {
FakeConstraints constraints;
- constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, "true");
+ constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, "false");
CreateVideoCapturerSource(&constraints);
- EXPECT_TRUE(source_->needs_denoising());
+ EXPECT_EQ(rtc::Optional<bool>(false), source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, NoiseReductionConstraintNotSet) {
FakeConstraints constraints;
CreateVideoCapturerSource(&constraints);
- EXPECT_FALSE(source_->needs_denoising());
+ EXPECT_EQ(rtc::Optional<bool>(), source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest,
@@ -355,7 +355,7 @@ TEST_F(VideoCapturerTrackSourceTest,
CreateVideoCapturerSource(&constraints);
- EXPECT_FALSE(source_->needs_denoising());
+ EXPECT_EQ(rtc::Optional<bool>(false), source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, NoiseReductionAndInvalidKeyOptional) {
@@ -367,7 +367,7 @@ TEST_F(VideoCapturerTrackSourceTest, NoiseReductionAndInvalidKeyOptional) {
EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
kMaxWaitMs);
- EXPECT_TRUE(source_->needs_denoising());
+ EXPECT_EQ(rtc::Optional<bool>(true), source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, NoiseReductionAndInvalidKeyMandatory) {
@@ -379,7 +379,7 @@ TEST_F(VideoCapturerTrackSourceTest, NoiseReductionAndInvalidKeyMandatory) {
EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(),
kMaxWaitMs);
- EXPECT_FALSE(source_->needs_denoising());
+ EXPECT_EQ(rtc::Optional<bool>(), source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueOptional) {
@@ -391,7 +391,8 @@ TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueOptional) {
EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(),
kMaxWaitMs);
- EXPECT_FALSE(source_->needs_denoising());
+
+ EXPECT_EQ(rtc::Optional<bool>(), source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueMandatory) {
@@ -405,7 +406,7 @@ TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueMandatory) {
EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(),
kMaxWaitMs);
- EXPECT_FALSE(source_->needs_denoising());
+ EXPECT_EQ(rtc::Optional<bool>(), source_->needs_denoising());
}
TEST_F(VideoCapturerTrackSourceTest, MixedOptionsAndConstraints) {
@@ -426,7 +427,7 @@ TEST_F(VideoCapturerTrackSourceTest, MixedOptionsAndConstraints) {
EXPECT_EQ(288, format->height);
EXPECT_EQ(30, format->framerate());
- EXPECT_FALSE(source_->needs_denoising());
+ EXPECT_EQ(rtc::Optional<bool>(false), source_->needs_denoising());
}
// Tests that the source starts video with the default resolution for
« no previous file with comments | « webrtc/api/videocapturertracksource.cc ('k') | webrtc/api/videosourceproxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698