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()); |
} |
} |