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

Unified Diff: webrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc

Issue 2543753006: AGC: Route clipping parameter from webrtc::Config to AGC (Closed)
Patch Set: Fix a typo Created 4 years 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/agc/agc_manager_direct_unittest.cc
diff --git a/webrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc b/webrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc
index 0a3ba84e59c60302f28b0531da8ad53169a89ea2..b582ae566985ad4ebd841d72d532de3a2e788cfc 100644
--- a/webrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc
+++ b/webrtc/modules/audio_processing/agc/agc_manager_direct_unittest.cc
@@ -33,6 +33,7 @@ const int kSampleRateHz = 32000;
const int kNumChannels = 1;
const int kSamplesPerChannel = kSampleRateHz / 100;
const int kInitialVolume = 128;
+constexpr int kClippedMin = 165; // Arbitrary, but different from the default.
const float kAboveClippedThreshold = 0.2f;
class TestVolumeCallbacks : public VolumeCallbacks {
@@ -50,7 +51,8 @@ class TestVolumeCallbacks : public VolumeCallbacks {
class AgcManagerDirectTest : public ::testing::Test {
protected:
AgcManagerDirectTest()
- : agc_(new MockAgc), manager_(agc_, &gctrl_, &volume_, kInitialVolume) {
+ : agc_(new MockAgc),
+ manager_(agc_, &gctrl_, &volume_, kInitialVolume, kClippedMin) {
ExpectInitialize();
manager_.Initialize();
}
@@ -505,13 +507,13 @@ TEST_F(AgcManagerDirectTest, ClippingLoweringIsLimited) {
.WillOnce(Return(kAboveClippedThreshold));
EXPECT_CALL(*agc_, Reset()).Times(1);
CallPreProc(1);
- EXPECT_EQ(170, volume_.GetMicVolume());
+ EXPECT_EQ(kClippedMin, volume_.GetMicVolume());
EXPECT_CALL(*agc_, AnalyzePreproc(_, _))
.WillRepeatedly(Return(kAboveClippedThreshold));
EXPECT_CALL(*agc_, Reset()).Times(0);
CallPreProc(1000);
- EXPECT_EQ(170, volume_.GetMicVolume());
+ EXPECT_EQ(kClippedMin, volume_.GetMicVolume());
}
TEST_F(AgcManagerDirectTest, ClippingMaxIsRespectedWhenEqualToLevel) {
@@ -589,7 +591,7 @@ TEST_F(AgcManagerDirectTest, MaxCompressionIsIncreasedAfterClipping) {
.WillOnce(Return(kAboveClippedThreshold));
EXPECT_CALL(*agc_, Reset()).Times(1);
CallPreProc(1);
- EXPECT_EQ(170, volume_.GetMicVolume());
+ EXPECT_EQ(kClippedMin, volume_.GetMicVolume());
// Current level is now at the minimum, but the maximum allowed level still
// has more to decrease.
« no previous file with comments | « webrtc/modules/audio_processing/agc/agc_manager_direct.cc ('k') | webrtc/modules/audio_processing/audio_processing_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698