chromium/services/audio/input_sync_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/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "services/audio/input_sync_writer.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>
#include <string>
#include <utility>

#include "base/compiler_specific.h"
#include "base/containers/span_writer.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/sync_socket.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/audio_bus.h"
#include "media/base/audio_glitch_info.h"
#include "media/base/audio_parameters.h"
#include "media/base/channel_layout.h"
#include "services/audio/input_glitch_counter.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;

namespace audio {

namespace {

// Number of audio buffers in the faked ring buffer.
const int kSegments =;

}  // namespace

// Mocked out sockets used for Send/ReceiveWithTimeout. Counts the number of
// outstanding reads, i.e. the diff between send and receive calls.
class MockCancelableSyncSocket : public base::CancelableSyncSocket {};

class MockInputGlitchCounter : public InputGlitchCounter {};

class InputSyncWriterTest : public testing::Test {};

TEST_F(InputSyncWriterTest, SingleWriteAndRead) {}

TEST_F(InputSyncWriterTest, MultipleWritesAndReads) {}

TEST_F(InputSyncWriterTest, MultipleWritesNoReads) {}

TEST_F(InputSyncWriterTest, FillAndEmptyRingBuffer) {}

TEST_F(InputSyncWriterTest, FillRingBufferAndFifo) {}

TEST_F(InputSyncWriterTest, MultipleFillAndEmptyRingBufferAndPartOfFifo) {}

TEST_F(InputSyncWriterTest, ShouldNotDropGlitchInfoInFifo) {}

TEST_F(InputSyncWriterTest, ShouldNotDropGlitchInfoWhenDroppingAudio) {}

}  // namespace audio