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

Side by Side Diff: webrtc/modules/audio_processing/test/debug_dump_test.cc

Issue 1886233003: Added a protobuf field for the audio processing module to store the status of experiments (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added unittest for reading of the added protobuf field 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 generator.Process(100); 334 generator.Process(100);
335 335
336 EchoCancellation* aec = generator.apm()->echo_cancellation(); 336 EchoCancellation* aec = generator.apm()->echo_cancellation();
337 EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(!aec->is_enabled())); 337 EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(!aec->is_enabled()));
338 338
339 generator.Process(100); 339 generator.Process(100);
340 generator.StopRecording(); 340 generator.StopRecording();
341 VerifyDebugDump(generator.dump_file_name()); 341 VerifyDebugDump(generator.dump_file_name());
342 } 342 }
343 343
344 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) {
345 Config config;
346 config.Set<EchoCanceller3>(new EchoCanceller3(true));
347 DebugDumpGenerator generator(config);
348 generator.StartRecording();
349 generator.Process(100);
350 generator.StopRecording();
351
352 DebugDumpReplayer debug_dump_replayer_;
353
354 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
355
356 while (const rtc::Optional<audioproc::Event> event =
357 debug_dump_replayer_.GetNextEvent()) {
358 debug_dump_replayer_.RunNextEvent();
359 if (event->type() == audioproc::Event::CONFIG) {
360 const audioproc::Config* msg = &event->config();
361 EXPECT_TRUE(msg->has_experiments_description());
362 EXPECT_NE(std::string::npos, msg->experiments_description().find("AEC3"));
363 }
364 }
365 }
366
367 TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) {
368 Config config;
369 DebugDumpGenerator generator(config);
370 generator.StartRecording();
371 generator.Process(100);
372 generator.StopRecording();
373
374 DebugDumpReplayer debug_dump_replayer_;
375
376 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name()));
377
378 while (const rtc::Optional<audioproc::Event> event =
379 debug_dump_replayer_.GetNextEvent()) {
380 debug_dump_replayer_.RunNextEvent();
381 if (event->type() == audioproc::Event::CONFIG) {
382 const audioproc::Config* msg = &event->config();
383 EXPECT_TRUE(msg->has_experiments_description());
384 EXPECT_EQ(0u, msg->experiments_description().size());
385 }
386 }
387 }
388
344 TEST_F(DebugDumpTest, ToggleAecLevel) { 389 TEST_F(DebugDumpTest, ToggleAecLevel) {
345 Config config; 390 Config config;
346 DebugDumpGenerator generator(config); 391 DebugDumpGenerator generator(config);
347 EchoCancellation* aec = generator.apm()->echo_cancellation(); 392 EchoCancellation* aec = generator.apm()->echo_cancellation();
348 EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(true)); 393 EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(true));
349 EXPECT_EQ(AudioProcessing::kNoError, 394 EXPECT_EQ(AudioProcessing::kNoError,
350 aec->set_suppression_level(EchoCancellation::kLowSuppression)); 395 aec->set_suppression_level(EchoCancellation::kLowSuppression));
351 generator.StartRecording(); 396 generator.StartRecording();
352 generator.Process(100); 397 generator.Process(100);
353 398
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 config.Set<ExperimentalNs>(new ExperimentalNs(true)); 442 config.Set<ExperimentalNs>(new ExperimentalNs(true));
398 DebugDumpGenerator generator(config); 443 DebugDumpGenerator generator(config);
399 generator.StartRecording(); 444 generator.StartRecording();
400 generator.Process(100); 445 generator.Process(100);
401 generator.StopRecording(); 446 generator.StopRecording();
402 VerifyDebugDump(generator.dump_file_name()); 447 VerifyDebugDump(generator.dump_file_name());
403 } 448 }
404 449
405 } // namespace test 450 } // namespace test
406 } // namespace webrtc 451 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/echo_cancellation_impl.cc ('k') | webrtc/modules/audio_processing/test/unpack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698