chromium/media/base/amplitude_peak_detector_unittest.cc

// Copyright 2023 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/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 {

// The loudness threshold in amplitude_peak_detector.cc corresponds to 0.5.
constexpr float kLoudSample =;
constexpr float kQuietSample =;

// Default values
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();

}  // namespace media