Chromium Code Reviews

Unified Diff: webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc

Issue 2611223003: Adding second layer of the echo canceller 3 functionality. (Closed)
Patch Set: Changes in response to reviewer comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
diff --git a/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc b/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
index 8baa45606f5474c598ada890a2a4fb2a276e0540..4df8aeaaca2091b55eef61b88022ec1319370afd 100644
--- a/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
+++ b/webrtc/modules/audio_processing/aec3/echo_canceller3_unittest.cc
@@ -82,16 +82,16 @@ class CaptureTransportVerificationProcessor : public BlockProcessor {
explicit CaptureTransportVerificationProcessor(size_t num_bands) {}
~CaptureTransportVerificationProcessor() override = default;
- void ProcessCapture(bool known_echo_path_change,
+ void ProcessCapture(bool level_change,
bool saturated_microphone_signal,
std::vector<std::vector<float>>* capture_block) override {
}
bool BufferRender(std::vector<std::vector<float>>* block) override {
- return false;
+ return true;
}
- void ReportEchoLeakage(bool leakage_detected) override {}
+ void UpdateEchoLeakageStatus(bool leakage_detected) override {}
private:
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTransportVerificationProcessor);
@@ -104,7 +104,7 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
explicit RenderTransportVerificationProcessor(size_t num_bands) {}
~RenderTransportVerificationProcessor() override = default;
- void ProcessCapture(bool known_echo_path_change,
+ void ProcessCapture(bool level_change,
bool saturated_microphone_signal,
std::vector<std::vector<float>>* capture_block) override {
std::vector<std::vector<float>> render_block =
@@ -115,10 +115,10 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
bool BufferRender(std::vector<std::vector<float>>* block) override {
received_render_blocks_.push_back(*block);
- return false;
+ return true;
}
- void ReportEchoLeakage(bool leakage_detected) override {}
+ void UpdateEchoLeakageStatus(bool leakage_detected) override {}
private:
std::deque<std::vector<std::vector<float>>> received_render_blocks_;
@@ -218,7 +218,7 @@ class EchoCanceller3Tester {
new StrictMock<webrtc::test::MockBlockProcessor>());
EXPECT_CALL(*block_processor_mock, BufferRender(_))
.Times(expected_num_block_to_process);
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(_)).Times(0);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0);
switch (echo_path_change_test_variant) {
case EchoPathChangeTestVariant::kNone:
@@ -300,18 +300,21 @@ class EchoCanceller3Tester {
switch (leakage_report_variant) {
case EchoLeakageTestVariant::kNone:
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(_)).Times(0);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0);
break;
case EchoLeakageTestVariant::kFalseSticky:
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(false)).Times(1);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(false))
+ .Times(1);
break;
case EchoLeakageTestVariant::kTrueSticky:
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(true)).Times(1);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(true))
+ .Times(1);
break;
case EchoLeakageTestVariant::kTrueNonSticky: {
testing::InSequence s;
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(true)).Times(1);
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(false))
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(true))
+ .Times(1);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(false))
.Times(kNumFramesToProcess - 1);
} break;
}
@@ -326,19 +329,19 @@ class EchoCanceller3Tester {
break;
case EchoLeakageTestVariant::kFalseSticky:
if (frame_index == 0) {
- aec3.ReportEchoLeakage(false);
+ aec3.UpdateEchoLeakageStatus(false);
}
break;
case EchoLeakageTestVariant::kTrueSticky:
if (frame_index == 0) {
- aec3.ReportEchoLeakage(true);
+ aec3.UpdateEchoLeakageStatus(true);
}
break;
case EchoLeakageTestVariant::kTrueNonSticky:
if (frame_index == 0) {
- aec3.ReportEchoLeakage(true);
+ aec3.UpdateEchoLeakageStatus(true);
} else {
- aec3.ReportEchoLeakage(false);
+ aec3.UpdateEchoLeakageStatus(false);
}
break;
}
@@ -382,7 +385,7 @@ class EchoCanceller3Tester {
new StrictMock<webrtc::test::MockBlockProcessor>());
EXPECT_CALL(*block_processor_mock, BufferRender(_))
.Times(expected_num_block_to_process);
- EXPECT_CALL(*block_processor_mock, ReportEchoLeakage(_)).Times(0);
+ EXPECT_CALL(*block_processor_mock, UpdateEchoLeakageStatus(_)).Times(0);
switch (saturation_variant) {
case SaturationTestVariant::kNone:

Powered by Google App Engine