chromium/media/audio/audio_debug_file_writer_unittest.cc

// Copyright 2015 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 <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) {}

// Serves only to expose the protected Create method of AudioDebugFileWriter.
class AudioDebugFileWriterUnderTest : public AudioDebugFileWriter {};

class MockAudioBusPool : public AudioBusPool {};

}  // namespace

// <channel layout, sample rate, frames per buffer, number of buffer writes
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();
}  // namespace media