OLD | NEW |
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 Loading... |
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, VerifyRefinedAdaptiveFilterExperimentalString) { |
| 345 Config config; |
| 346 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(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 ASSERT_TRUE(msg->has_experiments_description()); |
| 362 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", |
| 363 msg->experiments_description().c_str()); |
| 364 } |
| 365 } |
| 366 } |
| 367 |
| 368 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringInclusive) { |
| 369 Config config; |
| 370 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
| 371 config.Set<EchoCanceller3>(new EchoCanceller3(true)); |
| 372 DebugDumpGenerator generator(config); |
| 373 generator.StartRecording(); |
| 374 generator.Process(100); |
| 375 generator.StopRecording(); |
| 376 |
| 377 DebugDumpReplayer debug_dump_replayer_; |
| 378 |
| 379 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); |
| 380 |
| 381 while (const rtc::Optional<audioproc::Event> event = |
| 382 debug_dump_replayer_.GetNextEvent()) { |
| 383 debug_dump_replayer_.RunNextEvent(); |
| 384 if (event->type() == audioproc::Event::CONFIG) { |
| 385 const audioproc::Config* msg = &event->config(); |
| 386 ASSERT_TRUE(msg->has_experiments_description()); |
| 387 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", |
| 388 msg->experiments_description().c_str()); |
| 389 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3", |
| 390 msg->experiments_description().c_str()); |
| 391 } |
| 392 } |
| 393 } |
| 394 |
| 395 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { |
| 396 Config config; |
| 397 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); |
| 398 DebugDumpGenerator generator(config); |
| 399 generator.StartRecording(); |
| 400 generator.Process(100); |
| 401 generator.StopRecording(); |
| 402 |
| 403 DebugDumpReplayer debug_dump_replayer_; |
| 404 |
| 405 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); |
| 406 |
| 407 while (const rtc::Optional<audioproc::Event> event = |
| 408 debug_dump_replayer_.GetNextEvent()) { |
| 409 debug_dump_replayer_.RunNextEvent(); |
| 410 if (event->type() == audioproc::Event::CONFIG) { |
| 411 const audioproc::Config* msg = &event->config(); |
| 412 ASSERT_TRUE(msg->has_experiments_description()); |
| 413 EXPECT_PRED_FORMAT2(testing::IsSubstring, "RefinedAdaptiveFilter", |
| 414 msg->experiments_description().c_str()); |
| 415 EXPECT_PRED_FORMAT2(testing::IsNotSubstring, "AEC3", |
| 416 msg->experiments_description().c_str()); |
| 417 } |
| 418 } |
| 419 } |
| 420 |
344 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { | 421 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { |
345 Config config; | 422 Config config; |
346 config.Set<EchoCanceller3>(new EchoCanceller3(true)); | 423 config.Set<EchoCanceller3>(new EchoCanceller3(true)); |
347 DebugDumpGenerator generator(config); | 424 DebugDumpGenerator generator(config); |
348 generator.StartRecording(); | 425 generator.StartRecording(); |
349 generator.Process(100); | 426 generator.Process(100); |
350 generator.StopRecording(); | 427 generator.StopRecording(); |
351 | 428 |
352 DebugDumpReplayer debug_dump_replayer_; | 429 DebugDumpReplayer debug_dump_replayer_; |
353 | 430 |
354 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); | 431 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); |
355 | 432 |
356 while (const rtc::Optional<audioproc::Event> event = | 433 while (const rtc::Optional<audioproc::Event> event = |
357 debug_dump_replayer_.GetNextEvent()) { | 434 debug_dump_replayer_.GetNextEvent()) { |
358 debug_dump_replayer_.RunNextEvent(); | 435 debug_dump_replayer_.RunNextEvent(); |
359 if (event->type() == audioproc::Event::CONFIG) { | 436 if (event->type() == audioproc::Event::CONFIG) { |
360 const audioproc::Config* msg = &event->config(); | 437 const audioproc::Config* msg = &event->config(); |
361 EXPECT_TRUE(msg->has_experiments_description()); | 438 ASSERT_TRUE(msg->has_experiments_description()); |
362 EXPECT_NE(std::string::npos, msg->experiments_description().find("AEC3")); | 439 EXPECT_PRED_FORMAT2(testing::IsSubstring, "AEC3", |
| 440 msg->experiments_description().c_str()); |
363 } | 441 } |
364 } | 442 } |
365 } | 443 } |
366 | 444 |
367 TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) { | 445 TEST_F(DebugDumpTest, VerifyEmptyExperimentalString) { |
368 Config config; | 446 Config config; |
369 DebugDumpGenerator generator(config); | 447 DebugDumpGenerator generator(config); |
370 generator.StartRecording(); | 448 generator.StartRecording(); |
371 generator.Process(100); | 449 generator.Process(100); |
372 generator.StopRecording(); | 450 generator.StopRecording(); |
373 | 451 |
374 DebugDumpReplayer debug_dump_replayer_; | 452 DebugDumpReplayer debug_dump_replayer_; |
375 | 453 |
376 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); | 454 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); |
377 | 455 |
378 while (const rtc::Optional<audioproc::Event> event = | 456 while (const rtc::Optional<audioproc::Event> event = |
379 debug_dump_replayer_.GetNextEvent()) { | 457 debug_dump_replayer_.GetNextEvent()) { |
380 debug_dump_replayer_.RunNextEvent(); | 458 debug_dump_replayer_.RunNextEvent(); |
381 if (event->type() == audioproc::Event::CONFIG) { | 459 if (event->type() == audioproc::Event::CONFIG) { |
382 const audioproc::Config* msg = &event->config(); | 460 const audioproc::Config* msg = &event->config(); |
383 EXPECT_TRUE(msg->has_experiments_description()); | 461 ASSERT_TRUE(msg->has_experiments_description()); |
384 EXPECT_EQ(0u, msg->experiments_description().size()); | 462 EXPECT_EQ(0u, msg->experiments_description().size()); |
385 } | 463 } |
386 } | 464 } |
387 } | 465 } |
388 | 466 |
389 TEST_F(DebugDumpTest, ToggleAecLevel) { | 467 TEST_F(DebugDumpTest, ToggleAecLevel) { |
390 Config config; | 468 Config config; |
391 DebugDumpGenerator generator(config); | 469 DebugDumpGenerator generator(config); |
392 EchoCancellation* aec = generator.apm()->echo_cancellation(); | 470 EchoCancellation* aec = generator.apm()->echo_cancellation(); |
393 EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(true)); | 471 EXPECT_EQ(AudioProcessing::kNoError, aec->Enable(true)); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 config.Set<ExperimentalNs>(new ExperimentalNs(true)); | 520 config.Set<ExperimentalNs>(new ExperimentalNs(true)); |
443 DebugDumpGenerator generator(config); | 521 DebugDumpGenerator generator(config); |
444 generator.StartRecording(); | 522 generator.StartRecording(); |
445 generator.Process(100); | 523 generator.Process(100); |
446 generator.StopRecording(); | 524 generator.StopRecording(); |
447 VerifyDebugDump(generator.dump_file_name()); | 525 VerifyDebugDump(generator.dump_file_name()); |
448 } | 526 } |
449 | 527 |
450 } // namespace test | 528 } // namespace test |
451 } // namespace webrtc | 529 } // namespace webrtc |
OLD | NEW |