chromium/services/audio/public/cpp/output_device_unittest.cc

// Copyright 2018 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/public/cpp/output_device.h"

#include <utility>

#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "media/audio/audio_output_device.h"
#include "media/base/audio_renderer_sink.h"
#include "media/mojo/mojom/audio_data_pipe.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "services/audio/public/cpp/fake_stream_factory.h"
#include "services/audio/sync_reader.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/utility/utility.h"

_;
Invoke;
Mock;
NotNull;
StrictMock;
WithArg;

namespace audio {

namespace {

constexpr float kAudioData =;
constexpr base::TimeDelta kDelay =;
constexpr char kDeviceId[] =;
constexpr int kFrames =;
constexpr char kNonDefaultDeviceId[] =;
constexpr base::TimeDelta kAuthTimeout =;
constexpr int kBitstreamFrames =;
constexpr size_t kBitstreamDataSize =;

class MockRenderCallback : public media::AudioRendererSink::RenderCallback {};

class MockStream : public media::mojom::AudioOutputStream {};

class MockAudioOutputIPC : public media::AudioOutputIPC {};

class FakeOutputStreamFactory final : public audio::FakeStreamFactory {};

struct DataFlowTestEnvironment {};

}  // namespace

class AudioServiceOutputDeviceTest : public testing::Test {};

TEST_F(AudioServiceOutputDeviceTest, CreatePlayPause) {}

// Flaky on Linux Chromium OS ASan LSan (https://crbug.com/889845)
#if BUILDFLAG(IS_CHROMEOS_ASH) && defined(ADDRESS_SANITIZER)
#define MAYBE_VerifyDataFlow
#else
#define MAYBE_VerifyDataFlow
#endif
TEST_F(AudioServiceOutputDeviceTest, MAYBE_VerifyDataFlow) {}

TEST_F(AudioServiceOutputDeviceTest, CreateBitStreamStream) {}

TEST_F(AudioServiceOutputDeviceTest, CreateNondefaultDevice) {}

}  // namespace audio