#include "services/audio/output_device_mixer_impl.h"
#include <array>
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/test/task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
InSequence;
Mock;
Return;
StrictMock;
namespace audio {
namespace {
AudioOutputStream;
const std::string kDeviceId = …;
MATCHER_P(AudioParamsEq, other, "AudioParameters matcher") { … }
class MockListener : public ReferenceOutput::Listener { … };
class MockAudioOutputStream : public AudioOutputStream { … };
class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { … };
class MockMixingGraphInput : public MixingGraph::Input { … };
class FakeMixingGraphInput : public MixingGraph::Input { … };
class MockMixingGraph : public MixingGraph { … };
class OutputDeviceMixerImplTestBase { … };
class OutputDeviceMixerImplTest : public OutputDeviceMixerImplTestBase,
public testing::TestWithParam<int> { … };
class OutputDeviceMixerImplTestWithDefault
: public OutputDeviceMixerImplTestBase,
public testing::TestWithParam<std::string> { … };
TEST_P(OutputDeviceMixerImplTestWithDefault, OneUmixedStream_CreateClose) { … }
TEST_F(OutputDeviceMixerImplTest, OneUmixedStream_PhysicalStreamCreateFailed) { … }
TEST_F(OutputDeviceMixerImplTest, OneUmixedStream_PhysicalStreamOpenFailed) { … }
TEST_P(OutputDeviceMixerImplTestWithDefault, OneUmixedStream_CreateOpenClose) { … }
TEST_F(OutputDeviceMixerImplTest, TwoUmixedStream_CreateOpenClose) { … }
TEST_F(OutputDeviceMixerImplTest,
TwoUmixedStream_SecondOpenFailureDoesNotAffectMixerStream) { … }
TEST_F(OutputDeviceMixerImplTest, OneUmixedStream_SetVolumeIsPropagated) { … }
TEST_F(OutputDeviceMixerImplTest,
OneUmixedStream_CreateOpenPlayOnErrorStopClose) { … }
TEST_P(OutputDeviceMixerImplTest,
NStreamsOpen_StartStopListeningDoesNotStartMixing) { … }
TEST_P(OutputDeviceMixerImplTest, NStreamsPlaying_StartStopTwoListeners) { … }
TEST_P(OutputDeviceMixerImplTest,
NStreamsPlaying_StopStartListening_DoesNotStopMixing) { … }
TEST_P(OutputDeviceMixerImplTest,
StartStopNStreamsWhileListening_MixedPlaybackUntilListenerGone) { … }
TEST_P(OutputDeviceMixerImplTest, StartStopNStreamsWhileListening_DeleteMixer) { … }
TEST_F(OutputDeviceMixerImplTest,
DeleteMixer_WhileGraphOutputStreamStopIsDelayed) { … }
TEST_P(OutputDeviceMixerImplTest, NStreamsMixing_OnMixingStreamError) { … }
TEST_F(OutputDeviceMixerImplTest, OnMixingStreamError_Recovers) { … }
TEST_P(OutputDeviceMixerImplTest, NStreamsPlayingUmixed_DeviceChange) { … }
TEST_P(OutputDeviceMixerImplTest, NStreamsPlayingMixed_DeviceChange) { … }
TEST_F(OutputDeviceMixerImplTest, OnMoreDataDeliversCallbacks) { … }
TEST_F(OutputDeviceMixerImplTest,
MixingStreamCreationFailureHandledOnMixingPlaybackStart) { … }
TEST_F(OutputDeviceMixerImplTest,
MixingStreamOpenFailureHandled_ListenerPresent) { … }
TEST_F(OutputDeviceMixerImplTest,
MixingStreamOpenFailureHandled_WhenStartListening) { … }
TEST_F(OutputDeviceMixerImplTest,
MixingStreamCreationFailureHandled_NextMixingSuccessful) { … }
TEST_F(OutputDeviceMixerImplTest,
StartListening_OpenStream_StopListening_StartIndependentPlayback) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}
}