chromium/services/audio/output_device_mixer_impl_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/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") {}

// Mock listener.
class MockListener : public ReferenceOutput::Listener {};

// Mock of a physical output stream_under_test.
class MockAudioOutputStream : public AudioOutputStream {};

class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback {};

// Mocks interesting calls of MixingGraph::Input.
class MockMixingGraphInput : public MixingGraph::Input {};

// MixingGraph::Input eventually produced by MockMixingGraph::CreateInput().
// Delegates all the interesting calls to MockMixingGraphInput.
class FakeMixingGraphInput : public MixingGraph::Input {};

// Created and owned by OutputMixerManagerImpl; it's essentially a factory
// producing FGraphakeMixerInput instances.
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();

}  // namespace

}  // namespace audio