#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/base/amplitude_peak_detector.h"
#include <string_view>
#include "base/location.h"
#include "base/test/bind.h"
#include "media/base/audio_sample_types.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
constexpr float kLoudSample = …;
constexpr float kQuietSample = …;
constexpr int kChannels = …;
constexpr int kFrames = …;
struct SampleLocation { … };
class AmplitudePeakDetectorTest : public testing::TestWithParam<int> { … };
TEST_F(AmplitudePeakDetectorTest, Constructor) { … }
TEST_F(AmplitudePeakDetectorTest, NoPeaks_Silent) { … }
TEST_F(AmplitudePeakDetectorTest, NoPeaks_QuietValue) { … }
TEST_F(AmplitudePeakDetectorTest, Peaks_LoudValue) { … }
TEST_F(AmplitudePeakDetectorTest, Sequence_SilenceAndQuiet) { … }
TEST_F(AmplitudePeakDetectorTest, Sequence_ShortPeak) { … }
TEST_F(AmplitudePeakDetectorTest, Sequence_LongPeak) { … }
TEST_F(AmplitudePeakDetectorTest, NoTracing) { … }
class FixedSampleAmplitudePeakDetector : public AmplitudePeakDetectorTest { … };
TEST_P(FixedSampleAmplitudePeakDetector, NoPeaks_Silent) { … }
TEST_P(FixedSampleAmplitudePeakDetector, NoPeaks_Quiet) { … }
TEST_P(FixedSampleAmplitudePeakDetector, Peaks_Loud) { … }
TEST_F(FixedSampleAmplitudePeakDetector, Sequence_SilenceAndQuiet) { … }
TEST_F(FixedSampleAmplitudePeakDetector, Sequence_ShortPeak) { … }
TEST_P(FixedSampleAmplitudePeakDetector, Sequence_LongPeak) { … }
TEST_P(FixedSampleAmplitudePeakDetector, NoTracing) { … }
INSTANTIATE_TEST_SUITE_P(…);
}