#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/protocol/audio_pump.h"
#include <stddef.h>
#include <memory>
#include <utility>
#include <vector>
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "remoting/codec/audio_encoder.h"
#include "remoting/proto/audio.pb.h"
#include "remoting/protocol/audio_source.h"
#include "remoting/protocol/audio_stub.h"
#include "remoting/protocol/fake_audio_source.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace remoting::protocol {
namespace {
std::unique_ptr<AudioPacket> MakeAudioPacket(int channel_count = 2) { … }
}
class FakeAudioEncoder : public AudioEncoder { … };
class AudioPumpTest : public testing::Test, public protocol::AudioStub { … };
void AudioPumpTest::SetUp() { … }
void AudioPumpTest::TearDown() { … }
void AudioPumpTest::ProcessAudioPacket(
std::unique_ptr<AudioPacket> audio_packet,
base::OnceClosure done) { … }
TEST_F(AudioPumpTest, BufferSizeLimit) { … }
TEST_F(AudioPumpTest, DownmixAudioPacket) { … }
}