chromium/remoting/client/audio/audio_player_unittest.cc

// Copyright 2012 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 "remoting/client/audio/audio_player.h"

#include <cstdint>
#include <memory>

#include "base/compiler_specific.h"
#include "base/functional/callback.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

const int kAudioSamplesPerFrame =;
const int kAudioSampleBytes =;
const int kAudioFrameBytes =;
const int kPaddingBytes =;

// TODO(nicholss): Update legacy audio player to use new audio buffer code.
// TODO(garykac): Generate random audio data in the tests rather than having
// a single constant value.
const uint8_t kDefaultBufferData =;
const uint8_t kDummyAudioData =;

}  // namespace

namespace remoting {

class FakeAudioPlayer : public AudioPlayer {};

class AudioPlayerTest : public ::testing::Test {};

std::unique_ptr<AudioPacket> CreatePacketWithSamplingRate(
    AudioPacket::SamplingRate rate,
    int samples) {}

std::unique_ptr<AudioPacket> CreatePacket44100Hz(int samples) {}

std::unique_ptr<AudioPacket> CreatePacket48000Hz(int samples) {}

TEST_F(AudioPlayerTest, Init) {}

TEST_F(AudioPlayerTest, MultipleSamples) {}

TEST_F(AudioPlayerTest, ChangeSampleRate) {}

TEST_F(AudioPlayerTest, ExceedLatency) {}

// Incoming packets: 100
// Consume: 25 (w/ 75 remaining, offset 25 into packet)
TEST_F(AudioPlayerTest, ConsumePartialPacket) {}

// Incoming packets: 20, 70
// Consume: 25, 25 (w/ 40 remaining, offset 30 into packet)
TEST_F(AudioPlayerTest, ConsumeAcrossPackets) {}

// Incoming packets: 50, 30
// Consume: 25, 25, 25 (w/ 5 remaining, offset 25 into packet)
TEST_F(AudioPlayerTest, ConsumeEntirePacket) {}

// Incoming packets: <none>
// Consume: 25
TEST_F(AudioPlayerTest, NoDataToConsume) {}

// Incoming packets: 10
// Consume: 25
TEST_F(AudioPlayerTest, NotEnoughDataToConsume) {}

}  // namespace remoting