#include "services/audio/loopback_stream.h"
#include <cmath>
#include <cstdint>
#include <memory>
#include "base/containers/unique_ptr_adapters.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/ranges/algorithm.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "base/unguessable_token.h"
#include "media/base/audio_parameters.h"
#include "media/base/audio_timestamp_helper.h"
#include "media/base/channel_layout.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 "services/audio/loopback_coordinator.h"
#include "services/audio/loopback_group_member.h"
#include "services/audio/test/fake_consumer.h"
#include "services/audio/test/fake_loopback_group_member.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
Mock;
NiceMock;
StrictMock;
namespace audio {
namespace {
constexpr double kSnoopVolume = …;
constexpr double kLoopbackVolume = …;
constexpr double kMiddleAFreq = …;
constexpr double kMiddleCFreq = …;
constexpr base::TimeDelta kBufferDuration = …;
constexpr base::TimeDelta kDelayUntilOutput = …;
constexpr base::TimeDelta kTestRecordingDuration = …;
const media::AudioParameters& GetLoopbackStreamParams() { … }
class MockClientAndObserver : public media::mojom::AudioInputStreamClient,
public media::mojom::AudioInputStreamObserver { … };
class FakeSyncWriter : public FakeConsumer, public InputController::SyncWriter { … };
class LoopbackStreamTest : public testing::Test { … };
TEST_F(LoopbackStreamTest, ShutsDownStreamWhenInterfacePtrIsClosed) { … }
TEST_F(LoopbackStreamTest, ShutsDownStreamWhenClientBindingIsClosed) { … }
TEST_F(LoopbackStreamTest, ShutsDownStreamWhenObserverBindingIsClosed) { … }
TEST_F(LoopbackStreamTest, ProducesSilenceWhenNoMembersArePresent) { … }
#define EXPECT_TONE(ch, frequency, expected_amplitude) …
TEST_F(LoopbackStreamTest, ProducesAudioFromASingleSource) { … }
TEST_F(LoopbackStreamTest, ProducesAudioFromTwoSources) { … }
TEST_F(LoopbackStreamTest, AudioChangesVolume) { … }
}
}