Chromium Code Reviews| 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 EXPECT_TRUE(msg->has_experiments_description()); | |
|
hlundin-webrtc
2016/04/15 09:24:02
What happens with the call to msg->experiments_des
peah-webrtc
2016/04/15 10:08:40
Good point!
Done.
| |
| 362 EXPECT_NE(std::string::npos, | |
|
hlundin-webrtc
2016/04/15 09:24:02
I believe you can use the following pattern instea
peah-webrtc
2016/04/15 10:08:40
Thanks! That change gave much nicer output!
Done.
| |
| 363 msg->experiments_description().find("RefinedAdaptiveFilter")); | |
| 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 EXPECT_TRUE(msg->has_experiments_description()); | |
| 387 EXPECT_NE(std::string::npos, | |
| 388 msg->experiments_description().find("RefinedAdaptiveFilter")); | |
| 389 EXPECT_NE(std::string::npos, msg->experiments_description().find("AEC3")); | |
| 390 } | |
| 391 } | |
| 392 } | |
| 393 | |
| 394 TEST_F(DebugDumpTest, VerifyCombinedExperimentalStringExclusive) { | |
| 395 Config config; | |
| 396 config.Set<RefinedAdaptiveFilter>(new RefinedAdaptiveFilter(true)); | |
| 397 DebugDumpGenerator generator(config); | |
| 398 generator.StartRecording(); | |
| 399 generator.Process(100); | |
| 400 generator.StopRecording(); | |
| 401 | |
| 402 DebugDumpReplayer debug_dump_replayer_; | |
| 403 | |
| 404 ASSERT_TRUE(debug_dump_replayer_.SetDumpFile(generator.dump_file_name())); | |
| 405 | |
| 406 while (const rtc::Optional<audioproc::Event> event = | |
| 407 debug_dump_replayer_.GetNextEvent()) { | |
| 408 debug_dump_replayer_.RunNextEvent(); | |
| 409 if (event->type() == audioproc::Event::CONFIG) { | |
| 410 const audioproc::Config* msg = &event->config(); | |
| 411 EXPECT_TRUE(msg->has_experiments_description()); | |
| 412 EXPECT_NE(std::string::npos, | |
| 413 msg->experiments_description().find("RefinedAdaptiveFilter")); | |
| 414 EXPECT_EQ(std::string::npos, msg->experiments_description().find("AEC3")); | |
| 415 } | |
| 416 } | |
| 417 } | |
| 418 | |
| 344 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { | 419 TEST_F(DebugDumpTest, VerifyAec3ExperimentalString) { |
| 345 Config config; | 420 Config config; |
| 346 config.Set<EchoCanceller3>(new EchoCanceller3(true)); | 421 config.Set<EchoCanceller3>(new EchoCanceller3(true)); |
| 347 DebugDumpGenerator generator(config); | 422 DebugDumpGenerator generator(config); |
| 348 generator.StartRecording(); | 423 generator.StartRecording(); |
| 349 generator.Process(100); | 424 generator.Process(100); |
| 350 generator.StopRecording(); | 425 generator.StopRecording(); |
| 351 | 426 |
| 352 DebugDumpReplayer debug_dump_replayer_; | 427 DebugDumpReplayer debug_dump_replayer_; |
| 353 | 428 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 config.Set<ExperimentalNs>(new ExperimentalNs(true)); | 517 config.Set<ExperimentalNs>(new ExperimentalNs(true)); |
| 443 DebugDumpGenerator generator(config); | 518 DebugDumpGenerator generator(config); |
| 444 generator.StartRecording(); | 519 generator.StartRecording(); |
| 445 generator.Process(100); | 520 generator.Process(100); |
| 446 generator.StopRecording(); | 521 generator.StopRecording(); |
| 447 VerifyDebugDump(generator.dump_file_name()); | 522 VerifyDebugDump(generator.dump_file_name()); |
| 448 } | 523 } |
| 449 | 524 |
| 450 } // namespace test | 525 } // namespace test |
| 451 } // namespace webrtc | 526 } // namespace webrtc |
| OLD | NEW |