#include "third_party/blink/renderer/modules/media/audio/mojo_audio_input_ipc.h"
#include <algorithm>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/test/gtest_util.h"
#include "media/audio/audio_device_description.h"
#include "media/base/audio_capturer_source.h"
#include "media/base/audio_parameters.h"
#include "media/mojo/mojom/audio_data_pipe.mojom-blink.h"
#include "media/mojo/mojom/audio_processing.mojom-blink.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/buffer.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/utility/utility.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
_;
AtLeast;
Invoke;
Mock;
StrictMock;
namespace blink {
namespace {
const size_t kMemoryLength = …;
const size_t kTotalSegments = …;
const double kNewVolume = …;
const char kOutputDeviceId[] = …;
media::AudioParameters Params() { … }
media::AudioSourceParameters SourceParams() { … }
media::AudioSourceParameters SourceParamsWithProcessing() { … }
class MockStream : public media::mojom::blink::AudioInputStream { … };
class MockAudioProcessorControls
: public media::mojom::blink::AudioProcessorControls { … };
class MockDelegate : public media::AudioInputIPCDelegate { … };
class FakeStreamCreator { … };
void AssociateOutputForAec(const base::UnguessableToken& stream_id,
const std::string& output_device_id) { … }
}
TEST(MojoAudioInputIPC, OnStreamCreated_Propagates) { … }
TEST(MojoAudioInputIPC, OnStreamCreated_Propagates_WithProcessingConfig) { … }
TEST(MojoAudioInputIPC, FactoryDisconnected_SendsError) { … }
TEST(MojoAudioInputIPC, OnStreamCreated_PropagatesInitiallyMuted) { … }
TEST(MojoAudioInputIPC, IsReusable) { … }
TEST(MojoAudioInputIPC, IsReusableAfterError) { … }
TEST(MojoAudioInputIPC, Record_Records) { … }
TEST(MojoAudioInputIPC, SetVolume_SetsVolume) { … }
TEST(MojoAudioInputIPC, SetOutputDeviceForAec_AssociatesInputAndOutputForAec) { … }
TEST(MojoAudioInputIPC,
Controls_NotCalled_BeforeStreamCreated_WithoutProcessing) { … }
TEST(MojoAudioInputIPC,
Controls_NotCalled_AfterStreamCreated_WithoutProcessing) { … }
TEST(MojoAudioInputIPC, Controls_NotCalled_BeforeStreamCreated_WithProcessing) { … }
TEST(MojoAudioInputIPC, Controls_Called_AfterStreamCreated_WithProcessing) { … }
TEST(MojoAudioInputIPC, Controls_NotCalled_AfterStreamClosed_WithProcessing) { … }
}