#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stdint.h>
#include <limits>
#include <memory>
#include <utility>
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "base/test/task_environment.h"
#include "media/audio/audio_debug_file_writer.h"
#include "media/base/audio_bus.h"
#include "media/base/audio_bus_pool.h"
#include "media/base/audio_parameters.h"
#include "media/base/audio_sample_types.h"
#include "media/base/test_helpers.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
namespace media {
namespace {
static const uint16_t kBytesPerSample = …;
static const uint16_t kPcmEncoding = …;
static const size_t kWavHeaderSize = …;
uint16_t ReadLE2(const char* buf) { … }
uint32_t ReadLE4(const char* buf) { … }
base::File OpenFile(const base::FilePath& file_path) { … }
class AudioDebugFileWriterUnderTest : public AudioDebugFileWriter { … };
class MockAudioBusPool : public AudioBusPool { … };
}
AudioDebugFileWriterTestData;
class AudioDebugFileWriterTest
: public testing::TestWithParam<AudioDebugFileWriterTestData> { … };
class AudioDebugFileWriterBehavioralTest : public AudioDebugFileWriterTest { … };
class AudioDebugFileWriterSingleThreadTest : public AudioDebugFileWriterTest { … };
TEST_P(AudioDebugFileWriterTest, WaveRecordingTest) { … }
TEST_P(AudioDebugFileWriterBehavioralTest, ShouldReuseAudioBusesWithPool) { … }
TEST_P(AudioDebugFileWriterSingleThreadTest,
DeletedBeforeRecordingFinishedOnFileThread) { … }
TEST_P(AudioDebugFileWriterBehavioralTest, StartWithInvalidFile) { … }
TEST_P(AudioDebugFileWriterBehavioralTest, StartStopStartStop) { … }
TEST_P(AudioDebugFileWriterBehavioralTest, DestroyStarted) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}