chromium/services/audio/device_listener_output_stream_unittest.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/audio/device_listener_output_stream.h"

#include <optional>

#include "base/memory/raw_ptr.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/task_environment.h"
#include "media/audio/fake_audio_log_factory.h"
#include "media/audio/fake_audio_manager.h"
#include "media/audio/mock_audio_source_callback.h"
#include "media/audio/test_audio_thread.h"
#include "media/base/audio_parameters.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
InSequence;

AudioBus;
AudioManager;
AudioOutputStream;
MockAudioSourceCallback;

RunOnceClosure;

namespace audio {
namespace {

class MockAudioOutputStream : public AudioOutputStream {};

class FakeAudioManagerForDeviceChange : public media::FakeAudioManager {};

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

// Verifies DeviceListenerOutputStream forwards all calls to the wrapped stream.
TEST_F(DeviceListenerOutputStreamTest, DelegatesCallsToWrappedStream) {}

// Verifies DeviceListenerOutputStream calls device change callback on device
// change.
TEST_F(DeviceListenerOutputStreamTest, DeviceChangeNotification) {}

// Verifies DeviceListenerOutputStream calls device change callbacks on device
// change errors.
TEST_F(DeviceListenerOutputStreamTest, DeviceChangeError) {}

// Verifies DeviceListenerOutputStream forwards error callbacks.
TEST_F(DeviceListenerOutputStreamTest, UnknownError) {}

// Verifies DeviceListenerOutputStream elides error notifications during device
// changes.
TEST_F(DeviceListenerOutputStreamTest, ErrorThenDeviceChange) {}

// Verifies DeviceListenerOutputStream can be stopped after receiving an error.
TEST_F(DeviceListenerOutputStreamTest, ErrorThenStop) {}

}  // namespace
}  // namespace audio