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

Unified Diff: webrtc/modules/audio_processing/test/debug_dump_test.cc

Issue 1887003002: Added support in the AEC for refined filter adaptation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Changes in response to reviewer comments. Created 4 years, 8 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/test/debug_dump_test.cc
diff --git a/webrtc/modules/audio_processing/test/debug_dump_test.cc b/webrtc/modules/audio_processing/test/debug_dump_test.cc
index 60c1eb95117c1e59d66a330b207b93b2daf48b77..3acb69444d9334d2575d4ea813e449138775e751 100644
--- a/webrtc/modules/audio_processing/test/debug_dump_test.cc
+++ b/webrtc/modules/audio_processing/test/debug_dump_test.cc
@@ -341,6 +341,83 @@ TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) {
VerifyDebugDump(generator.dump_file_name());
}
+TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) {
+ Config config;
+ config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
+ DebugDumpGenerator generator(config);
+ generator.StartRecording();
+ generator.Process(100);
+ generator.StopRecording();
+
+ DebugDumpReplayer debug_dump_replayer_;
+
+ ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
+
+ while (const rtc::Optional<audioproc::Event> event =
+ debug_dump_replayer_.GetNextEvent()) {
+ debug_dump_replayer_.RunNextEvent();
+ if (event->type() == audioproc::Event::CONFIG) {
+ const audioproc::Config* msg = &event->config();
+ ASSERT_TRUE(msg->has_experiments_description());
+ EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter",
+ msg->experiments_description().c_str());
+ }
+ }
+}
+
+TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) {
+ Config config;
+ config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
+ config.Set<EchoCanceller3>(new EchoCanceller3(true));
+ DebugDumpGenerator generator(config);
+ generator.StartRecording();
+ generator.Process(100);
+ generator.StopRecording();
+
+ DebugDumpReplayer debug_dump_replayer_;
+
+ ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
+
+ while (const rtc::Optional<audioproc::Event> event =
+ debug_dump_replayer_.GetNextEvent()) {
+ debug_dump_replayer_.RunNextEvent();
+ if (event->type() == audioproc::Event::CONFIG) {
+ const audioproc::Config* msg = &event->config();
+ ASSERT_TRUE(msg->has_experiments_description());
+ EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter",
+ msg->experiments_description().c_str());
+ EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3",
+ msg->experiments_description().c_str());
+ }
+ }
+}
+
+TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) {
+ Config config;
+ config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true));
+ DebugDumpGenerator generator(config);
+ generator.StartRecording();
+ generator.Process(100);
+ generator.StopRecording();
+
+ DebugDumpReplayer debug_dump_replayer_;
+
+ ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
+
+ while (const rtc::Optional<audioproc::Event> event =
+ debug_dump_replayer_.GetNextEvent()) {
+ debug_dump_replayer_.RunNextEvent();
+ if (event->type() == audioproc::Event::CONFIG) {
+ const audioproc::Config* msg = &event->config();
+ ASSERT_TRUE(msg->has_experiments_description());
+ EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter",
+ msg->experiments_description().c_str());
+ EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AEC3",
+ msg->experiments_description().c_str());
+ }
+ }
+}
+
TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
Config config;
config.Set<EchoCanceller3>(new EchoCanceller3(true));
@@ -358,8 +435,9 @@ TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
debug_dump_replayer_.RunNextEvent();
if (event->type() == audioproc::Event::CONFIG) {
const audioproc::Config* msg = &event->config();
- EXPECT_TRUE(msg->has_experiments_description());
- EXPECT_NE(std::string::npos, msg->experiments_description().find("AEC3"));
+ ASSERT_TRUE(msg->has_experiments_description());
+ EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3",
+ msg->experiments_description().c_str());
}
}
}
@@ -380,7 +458,7 @@ TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
debug_dump_replayer_.RunNextEvent();
if (event->type() == audioproc::Event::CONFIG) {
const audioproc::Config* msg = &event->config();
- EXPECT_TRUE(msg->has_experiments_description());
+ ASSERT_TRUE(msg->has_experiments_description());
EXPECT_EQ(0u, msg->experiments_description().size());
}
}
« no previous file with comments | « webrtc/modules/audio_processing/include/audio_processing.h ('k') | webrtc/modules/audio_processing/test/process_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698