#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/base/audio_power_monitor.h"
#include <limits>
#include <memory>
#include "base/time/time.h"
#include "media/base/audio_bus.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
static const int kSampleRate = …;
static const int kFramesPerBuffer = …;
static const int kTimeConstantMillis = …;
namespace {
class TestScenario { … };
::std::ostream& operator<<(::std::ostream& os, const TestScenario& ts) { … }
class MeasurementObserver { … };
}
class AudioPowerMonitorTest : public ::testing::TestWithParam<TestScenario> { … };
TEST_P(AudioPowerMonitorTest, MeasuresPowerOfSignal) { … }
static const float kMonoSilentNoise[] = …;
static const float kMonoMaxAmplitude[] = …;
static const float kMonoMaxAmplitude2[] = …;
static const float kMonoHalfMaxAmplitude[] = …;
static const float kMonoAmplitudeClipped[] = …;
static const float kMonoMaxAmplitudeWithClip[] = …;
static const float kMonoMaxAmplitudeWithClip2[] = …;
static const float kStereoSilentNoise[] = …;
static const float kStereoMaxAmplitude[] = …;
static const float kRightChannelMaxAmplitude[] = …;
static const float kLeftChannelHalfMaxAmplitude[] = …;
static const float kStereoMixed[] = …;
static const float kStereoMixed2[] = …;
INSTANTIATE_TEST_SUITE_P(…);
}