#ifdef UNSAFE_BUFFERS_BUILD
#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 {
const int kSegments = …;
}
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) { … }
}