#include "media/mojo/services/mojo_audio_input_stream.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/run_loop.h"
#include "base/sync_socket.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
namespace {
const double kNewVolume = …;
const int kStreamId = …;
const int kShmemSize = …;
const bool kInitiallyNotMuted = …;
_;
Mock;
NotNull;
Return;
SaveArg;
StrictMock;
Test;
AudioInputStream;
class TestCancelableSyncSocket : public base::CancelableSyncSocket { … };
class MockDelegate : public AudioInputDelegate { … };
class MockDelegateFactory { … };
class MockDeleter { … };
class MockClient : public mojom::AudioInputStreamClient { … };
std::unique_ptr<AudioInputDelegate> CreateNoDelegate(
AudioInputDelegate::EventHandler* event_handler) { … }
void NotCalled(mojom::ReadOnlyAudioDataPipePtr data_pipe,
bool initially_muted) { … }
}
class MojoAudioInputStreamTest : public Test { … };
TEST_F(MojoAudioInputStreamTest, NoDelegate_SignalsError) { … }
TEST_F(MojoAudioInputStreamTest, Record_Records) { … }
TEST_F(MojoAudioInputStreamTest, SetVolume_SetsVolume) { … }
TEST_F(MojoAudioInputStreamTest, DestructWithCallPending_Safe) { … }
TEST_F(MojoAudioInputStreamTest, Created_NotifiesClient) { … }
TEST_F(MojoAudioInputStreamTest, SetVolumeTooLarge_Error) { … }
TEST_F(MojoAudioInputStreamTest, SetVolumeNegative_Error) { … }
TEST_F(MojoAudioInputStreamTest, DelegateErrorBeforeCreated_PropagatesError) { … }
TEST_F(MojoAudioInputStreamTest, DelegateErrorAfterCreated_PropagatesError) { … }
TEST_F(MojoAudioInputStreamTest, RemoteEndGone_Error) { … }
}