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

Unified Diff: webrtc/modules/audio_processing/audio_processing_unittest.cc

Issue 2415403002: Introduced the new parameter setting scheme for activating the high-pass filter in APM (Closed)
Patch Set: New approach for introducing the new parameter setting scheme Created 4 years, 2 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/modules/audio_processing/audio_processing_unittest.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_unittest.cc b/webrtc/modules/audio_processing/audio_processing_unittest.cc
index d4faa812055eac5a0f9808a89a3e06f7aa2a9763..e6512a8a24262458e530fb1875a5efb8941b4ef5 100644
--- a/webrtc/modules/audio_processing/audio_processing_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_unittest.cc
@@ -185,7 +185,10 @@ void EnableAllAPComponents(AudioProcessing* ap) {
EXPECT_NOERR(ap->gain_control()->Enable(true));
#endif
- EXPECT_NOERR(ap->high_pass_filter()->Enable(true));
+ AudioProcessing::Config apm_config;
+ apm_config.high_pass_filter.enabled = true;
+ ap->ApplyConfig(apm_config);
+
EXPECT_NOERR(ap->level_estimator()->Enable(true));
EXPECT_NOERR(ap->noise_suppression()->Enable(true));
@@ -1390,10 +1393,11 @@ TEST_F(ApmTest, NoiseSuppression) {
TEST_F(ApmTest, HighPassFilter) {
// Turn HP filter on/off
- EXPECT_EQ(apm_->kNoError, apm_->high_pass_filter()->Enable(true));
- EXPECT_TRUE(apm_->high_pass_filter()->is_enabled());
- EXPECT_EQ(apm_->kNoError, apm_->high_pass_filter()->Enable(false));
- EXPECT_FALSE(apm_->high_pass_filter()->is_enabled());
+ AudioProcessing::Config apm_config;
+ apm_config.high_pass_filter.enabled = true;
+ apm_->ApplyConfig(apm_config);
+ apm_config.high_pass_filter.enabled = false;
+ apm_->ApplyConfig(apm_config);
}
TEST_F(ApmTest, LevelEstimator) {
@@ -1528,7 +1532,6 @@ TEST_F(ApmTest, AllProcessingDisabledByDefault) {
EXPECT_FALSE(apm_->echo_cancellation()->is_enabled());
EXPECT_FALSE(apm_->echo_control_mobile()->is_enabled());
EXPECT_FALSE(apm_->gain_control()->is_enabled());
- EXPECT_FALSE(apm_->high_pass_filter()->is_enabled());
EXPECT_FALSE(apm_->level_estimator()->is_enabled());
EXPECT_FALSE(apm_->noise_suppression()->is_enabled());
EXPECT_FALSE(apm_->voice_detection()->is_enabled());

Powered by Google App Engine
This is Rietveld 408576698