OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <string> |
| 6 #include <vector> |
| 7 |
| 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/strings/stringprintf.h" |
| 10 #include "chromecast/media/cma/backend/alsa/post_processors/post_processor_unitt
est.h" |
| 11 #include "chromecast/media/cma/backend/alsa/post_processors/saturated_gain.h" |
| 12 |
| 13 namespace chromecast { |
| 14 namespace media { |
| 15 namespace post_processor_test { |
| 16 |
| 17 namespace { |
| 18 |
| 19 const char* kConfigTemplate = |
| 20 R"config({"gain_db": %f})config"; |
| 21 |
| 22 std::string MakeConfigString(float gain_db) { |
| 23 return base::StringPrintf(kConfigTemplate, gain_db); |
| 24 } |
| 25 |
| 26 } // namespace |
| 27 |
| 28 // Default tests from post_processor_test |
| 29 TEST_P(PostProcessorTest, TestDelay) { |
| 30 std::string config = MakeConfigString(0.0); |
| 31 auto pp = |
| 32 base::WrapUnique(AudioPostProcessorShlib_Create(config, kNumChannels)); |
| 33 TestDelay(pp.get(), sample_rate_); |
| 34 } |
| 35 |
| 36 TEST_P(PostProcessorTest, TestRinging) { |
| 37 std::string config = MakeConfigString(0.0); |
| 38 auto pp = |
| 39 base::WrapUnique(AudioPostProcessorShlib_Create(config, kNumChannels)); |
| 40 TestRingingTime(pp.get(), sample_rate_); |
| 41 } |
| 42 |
| 43 // Also tests clipping (by attempting to set gain way too high). |
| 44 TEST_P(PostProcessorTest, TestPassthrough) { |
| 45 std::string config = MakeConfigString(100.0); |
| 46 auto pp = |
| 47 base::WrapUnique(AudioPostProcessorShlib_Create(config, kNumChannels)); |
| 48 TestPassthrough(pp.get(), sample_rate_); |
| 49 } |
| 50 |
| 51 } // namespace post_processor_test |
| 52 } // namespace media |
| 53 } // namespace chromecast |
OLD | NEW |