#include <stdint.h>
#include <memory>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
#include "media/audio/audio_manager.h"
#include "media/audio/audio_manager_base.h"
#include "media/audio/audio_output_dispatcher_impl.h"
#include "media/audio/audio_output_proxy.h"
#include "media/audio/audio_output_resampler.h"
#include "media/audio/fake_audio_log_factory.h"
#include "media/audio/fake_audio_output_stream.h"
#include "media/audio/test_audio_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
AllOf;
DoAll;
Field;
Mock;
NotNull;
Return;
SetArrayArgument;
AudioBus;
AudioInputStream;
AudioManager;
AudioManagerBase;
AudioOutputDispatcher;
AudioOutputProxy;
AudioOutputStream;
AudioParameters;
FakeAudioOutputStream;
TestAudioThread;
namespace {
static const int kTestCloseDelayMs = …;
static const int kOnMoreDataCallbackDelayMs = …;
static const int kStartRunTimeMs = …;
std::unique_ptr<media::AudioDebugRecorder> RegisterDebugRecording(
const media::AudioParameters& params) { … }
class MockAudioOutputStream : public AudioOutputStream { … };
class CallbackExposingMockOutputStream : public AudioOutputStream { … };
class MockAudioManager : public AudioManagerBase { … };
class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { … };
}
namespace media {
class AudioOutputProxyTest : public testing::Test { … };
class AudioOutputResamplerTest : public AudioOutputProxyTest { … };
TEST_F(AudioOutputProxyTest, CreateAndClose) { … }
TEST_F(AudioOutputResamplerTest, CreateAndClose) { … }
TEST_F(AudioOutputProxyTest, OpenAndClose) { … }
TEST_F(AudioOutputResamplerTest, OpenAndClose) { … }
TEST_F(AudioOutputProxyTest, CreateAndWait) { … }
TEST_F(AudioOutputResamplerTest, CreateAndWait) { … }
TEST_F(AudioOutputProxyTest, StartAndStop) { … }
TEST_F(AudioOutputResamplerTest, StartAndStop) { … }
TEST_F(AudioOutputProxyTest, CloseAfterStop) { … }
TEST_F(AudioOutputResamplerTest, CloseAfterStop) { … }
TEST_F(AudioOutputProxyTest, TwoStreams) { … }
TEST_F(AudioOutputResamplerTest, TwoStreams) { … }
TEST_F(AudioOutputProxyTest, OneStream_TwoPlays) { … }
TEST_F(AudioOutputResamplerTest, OneStream_TwoPlays) { … }
TEST_F(AudioOutputProxyTest, TwoStreams_BothPlaying) { … }
TEST_F(AudioOutputResamplerTest, TwoStreams_BothPlaying) { … }
TEST_F(AudioOutputProxyTest, OpenFailed) { … }
TEST_F(AudioOutputProxyTest, StartFailed) { … }
TEST_F(AudioOutputResamplerTest, StartFailed) { … }
TEST_F(AudioOutputProxyTest, DispatcherDestroyed_BeforeOpen) { … }
TEST_F(AudioOutputResamplerTest, DispatcherDestroyed_BeforeOpen) { … }
TEST_F(AudioOutputProxyTest, DispatcherDestroyed_BeforeStart) { … }
TEST_F(AudioOutputResamplerTest, DispatcherDestroyed_BeforeStart) { … }
TEST_F(AudioOutputProxyTest, DispatcherDestroyed_BeforeStop) { … }
TEST_F(AudioOutputResamplerTest, DispatcherDestroyed_BeforeStop) { … }
TEST_F(AudioOutputProxyTest, DispatcherDestroyed_AfterStop) { … }
TEST_F(AudioOutputResamplerTest, DispatcherDestroyed_AfterStop) { … }
TEST_F(AudioOutputProxyTest, DispatcherDeviceChangeClosesIdleStreams) { … }
TEST_F(AudioOutputResamplerTest, LowLatencyCreateFailedFallback) { … }
TEST_F(AudioOutputResamplerTest, LowLatencyOpenFailedFallback) { … }
TEST_F(AudioOutputResamplerTest, HighLatencyFallbackFailed) { … }
TEST_F(AudioOutputResamplerTest, AllFallbackFailed) { … }
TEST_F(AudioOutputResamplerTest, LowLatencyOpenEventuallyFails) { … }
TEST_F(AudioOutputResamplerTest, FallbackRecovery) { … }
TEST_F(AudioOutputResamplerTest, PropagatesGlitchInfo) { … }
}