#include "services/audio/processing_audio_fifo.h"
#include <cstring>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/bind.h"
#include "base/time/time.h"
#include "media/audio/simple_sources.h"
#include "media/base/audio_glitch_info.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace audio {
const int kSampleRate = …;
const int kFramesPerBuffer = …;
const int kTestToneFrequency = …;
const int kTestFifoSize = …;
const double kTestVolume = …;
struct TestCaptureData { … };
void VerifyAudioDataEqual(const media::AudioBus& first,
const media::AudioBus& second) { … }
void VerifyProcessingData(const TestCaptureData& expected_data,
const media::AudioBus& audio_bus,
base::TimeTicks capture_time,
double volume,
bool key_pressed,
const media::AudioGlitchInfo& audio_glitch_info) { … }
class ProcessingAudioFifoTest : public testing::Test { … };
TEST_F(ProcessingAudioFifoTest, ConstructDestroy) { … }
TEST_F(ProcessingAudioFifoTest, ConstructStartDestroy) { … }
TEST_F(ProcessingAudioFifoTest, PushData_OneBuffer) { … }
TEST_F(ProcessingAudioFifoTest, PushData_MultipleBuffers_SingleBatch) { … }
TEST_F(ProcessingAudioFifoTest, PushData_MultipleBuffers_WaitBetweenBuffers) { … }
TEST_F(ProcessingAudioFifoTest, ProcessesAllAvailableData) { … }
TEST_F(ProcessingAudioFifoTest, NoDataToProcess) { … }
TEST_F(ProcessingAudioFifoTest, DontProcessPendingDataDuringStop) { … }
TEST_F(ProcessingAudioFifoTest, FifoFull_DroppedFrames_SavesGlitchInfo) { … }
TEST_F(ProcessingAudioFifoTest, StopDuringBatchProcess) { … }
}