chromium/media/base/audio_power_monitor_unittest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#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 {

// Container for each parameterized test's data (input and expected results).
class TestScenario {};

// Value printer for TestScenario.  Required to prevent Valgrind "access to
// uninitialized memory" errors (http://crbug.com/263315).
::std::ostream& operator<<(::std::ostream& os, const TestScenario& ts) {}

// An observer that receives power measurements.  Each power measurement should
// should make progress towards the goal value.
class MeasurementObserver {};

}  // namespace

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();

}  // namespace media