#include "media/audio/audio_output_device.h"
#include <stdint.h>
#include <utility>
#include <vector>
#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/shared_memory_mapping.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/sync_socket.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner.h"
#include "base/test/bind.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
CancelableSyncSocket;
UnsafeSharedMemoryRegion;
WritableSharedMemoryMapping;
SyncSocket;
_;
DoAll;
Invoke;
Return;
WithArg;
StrictMock;
NiceMock;
NotNull;
Mock;
namespace media {
namespace {
constexpr char kDefaultDeviceId[] = …;
constexpr char kNonDefaultDeviceId[] = …;
constexpr char kUnauthorizedDeviceId[] = …;
constexpr base::TimeDelta kAuthTimeout = …;
class MockRenderCallback : public AudioRendererSink::RenderCallback { … };
class MockAudioOutputIPC : public AudioOutputIPC { … };
}
class AudioOutputDeviceTest : public testing::Test { … };
AudioOutputDeviceTest::AudioOutputDeviceTest()
: … { … }
AudioOutputDeviceTest::~AudioOutputDeviceTest() = default;
void AudioOutputDeviceTest::CreateDevice(const std::string& device_id,
base::TimeDelta timeout) { … }
void AudioOutputDeviceTest::SetDevice(const std::string& device_id) { … }
void AudioOutputDeviceTest::ReceiveAuthorization(OutputDeviceStatus status) { … }
void AudioOutputDeviceTest::StartAudioDevice() { … }
void AudioOutputDeviceTest::CallOnStreamCreated() { … }
void AudioOutputDeviceTest::StopAudioDevice() { … }
void AudioOutputDeviceTest::FlushAudioDevice() { … }
void AudioOutputDeviceTest::Render() { … }
void AudioOutputDeviceTest::CloseBrowserSocket() { … }
TEST_F(AudioOutputDeviceTest, Initialize) { … }
TEST_F(AudioOutputDeviceTest, StartStop) { … }
TEST_F(AudioOutputDeviceTest, StartStopStartStop) { … }
TEST_F(AudioOutputDeviceTest, StopBeforeRender) { … }
TEST_F(AudioOutputDeviceTest, NoErrorForNormalShutdown) { … }
TEST_F(AudioOutputDeviceTest, ErrorFiredForSocketClose) { … }
TEST_F(AudioOutputDeviceTest, NonDefaultStartStopStartStop) { … }
TEST_F(AudioOutputDeviceTest, UnauthorizedDevice) { … }
TEST_F(AudioOutputDeviceTest,
StartUnauthorizedDeviceAndStopBeforeErrorFires_NoError) { … }
TEST_F(AudioOutputDeviceTest, AuthorizationFailsBeforeInitialize_NoError) { … }
TEST_F(AudioOutputDeviceTest, AuthorizationTimedOut) { … }
TEST_F(AudioOutputDeviceTest, GetOutputDeviceInfoAsync_Error) { … }
TEST_F(AudioOutputDeviceTest, GetOutputDeviceInfoAsync_Okay) { … }
TEST_F(AudioOutputDeviceTest, StreamIsFlushed) { … }
}