Chromium Code Reviews| 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 103f8e109aadf15a0de5b70ef7db99b236fa94bc..d46cb1f330b31b92ca36f45c3da0254126c12ebb 100644 |
| --- a/webrtc/modules/audio_processing/test/debug_dump_test.cc |
| +++ b/webrtc/modules/audio_processing/test/debug_dump_test.cc |
| @@ -48,7 +48,8 @@ class DebugDumpGenerator { |
| const std::string& dump_file_name); |
| // Constructor that uses default input files. |
| - explicit DebugDumpGenerator(const Config& config); |
| + explicit DebugDumpGenerator(const Config& config, |
| + const ApmSettings& apm_settings); |
| ~DebugDumpGenerator(); |
| @@ -133,11 +134,18 @@ DebugDumpGenerator::DebugDumpGenerator(const std::string& input_file_name, |
| dump_file_name_(dump_file_name) { |
| } |
| -DebugDumpGenerator::DebugDumpGenerator(const Config& config) |
| - : DebugDumpGenerator(ResourcePath("near32_stereo", "pcm"), 32000, 2, |
| - ResourcePath("far32_stereo", "pcm"), 32000, 2, |
| - config, |
| - TempFilename(OutputPath(), "debug_aec")) { |
| +DebugDumpGenerator::DebugDumpGenerator(const Config& config, |
| + const ApmSettings& apm_settings) |
| + : DebugDumpGenerator(ResourcePath("near32_stereo", "pcm"), |
| + 32000, |
| + 2, |
| + ResourcePath("far32_stereo", "pcm"), |
| + 32000, |
| + 2, |
| + config, |
| + TempFilename(OutputPath(), "debug_aec")) { |
| + RTC_DCHECK(apm_settings.IsOk()); |
|
hlundin-webrtc
2016/08/30 11:26:26
RTC_CHECK
peah-webrtc
2016/08/30 17:05:58
Done.
|
| + apm_->ApplySettings(apm_settings); |
| } |
| DebugDumpGenerator::~DebugDumpGenerator() { |
| @@ -265,7 +273,8 @@ void DebugDumpTest::VerifyDebugDump(const std::string& in_filename) { |
| TEST_F(DebugDumpTest, SimpleCase) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |
| @@ -274,7 +283,9 @@ TEST_F(DebugDumpTest, SimpleCase) { |
| TEST_F(DebugDumpTest, ChangeInputFormat) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| + |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.SetInputRate(48000); |
| @@ -291,7 +302,8 @@ TEST_F(DebugDumpTest, ChangeInputFormat) { |
| TEST_F(DebugDumpTest, ChangeReverseFormat) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.SetReverseRate(48000); |
| @@ -303,7 +315,8 @@ TEST_F(DebugDumpTest, ChangeReverseFormat) { |
| TEST_F(DebugDumpTest, ChangeOutputFormat) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.SetOutputRate(48000); |
| @@ -315,7 +328,8 @@ TEST_F(DebugDumpTest, ChangeOutputFormat) { |
| TEST_F(DebugDumpTest, ToggleAec) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| @@ -329,8 +343,9 @@ TEST_F(DebugDumpTest, ToggleAec) { |
| TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) { |
| Config config; |
| + ApmSettings apm_settings; |
| config.Set<DelayAgnostic>(new DelayAgnostic(true)); |
| - DebugDumpGenerator generator(config); |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| @@ -344,8 +359,9 @@ TEST_F(DebugDumpTest, ToggleDelayAgnosticAec) { |
| TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) { |
| Config config; |
| + ApmSettings apm_settings; |
| config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
| - DebugDumpGenerator generator(config); |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |
| @@ -368,9 +384,10 @@ TEST_F(DebugDumpTest, VerifyRefinedAdaptiveFilterExperimentalString) { |
| TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) { |
| Config config; |
| + ApmSettings apm_settings; |
| config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
| config.Set<EchoCanceller3>(new EchoCanceller3(true)); |
| - DebugDumpGenerator generator(config); |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |
| @@ -395,8 +412,9 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) { |
| TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { |
| Config config; |
| + ApmSettings apm_settings; |
| config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
| - DebugDumpGenerator generator(config); |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |
| @@ -421,8 +439,9 @@ TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { |
| TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { |
| Config config; |
| + ApmSettings apm_settings; |
| config.Set<EchoCanceller3>(new EchoCanceller3(true)); |
| - DebugDumpGenerator generator(config); |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |
| @@ -445,8 +464,9 @@ TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { |
| TEST_F(DebugDumpTest, VerifyLevelControllerExperimentalString) { |
| Config config; |
| - config.Set<LevelControl>(new LevelControl(true)); |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + apm_settings.level_controller.enabled = true; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |
| @@ -469,7 +489,8 @@ TEST_F(DebugDumpTest, VerifyLevelControllerExperimentalString) { |
| TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |
| @@ -491,7 +512,8 @@ TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) { |
| TEST_F(DebugDumpTest, ToggleAecLevel) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| EchoCancellation* aec = generator.apm()->echo_cancellation(); |
| EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(true)); |
| EXPECT_EQ(AudioProcessing::kNoError, |
| @@ -514,7 +536,8 @@ TEST_F(DebugDumpTest, ToggleAecLevel) { |
| #endif |
| TEST_F(DebugDumpTest, MAYBE_ToggleAgc) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| @@ -528,7 +551,8 @@ TEST_F(DebugDumpTest, MAYBE_ToggleAgc) { |
| TEST_F(DebugDumpTest, ToggleNs) { |
| Config config; |
| - DebugDumpGenerator generator(config); |
| + ApmSettings apm_settings; |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| @@ -542,8 +566,9 @@ TEST_F(DebugDumpTest, ToggleNs) { |
| TEST_F(DebugDumpTest, TransientSuppressionOn) { |
| Config config; |
| + ApmSettings apm_settings; |
| config.Set<ExperimentalNs>(new ExperimentalNs(true)); |
| - DebugDumpGenerator generator(config); |
| + DebugDumpGenerator generator(config, apm_settings); |
| generator.StartRecording(); |
| generator.Process(100); |
| generator.StopRecording(); |