chromium/third_party/blink/renderer/modules/media/audio/mojo_audio_output_ipc_test.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/media/audio/mojo_audio_output_ipc.h"

#include <algorithm>
#include <memory>
#include <optional>
#include <string>
#include <utility>

#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/gtest_util.h"
#include "media/audio/audio_device_description.h"
#include "media/base/audio_parameters.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/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/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"

_;
AtLeast;
Invoke;
Mock;
StrictMock;

namespace blink {

namespace {

const size_t kMemoryLength =;
const char kDeviceId[] =;
const char kReturnedDeviceId[] =;
const double kNewVolume =;

media::AudioParameters Params() {}

MojoAudioOutputIPC::FactoryAccessorCB NullAccessor() {}

// TODO(https://crbug.com/787252): Convert the test away from using std::string.
class TestStreamProvider
    : public media::mojom::blink::AudioOutputStreamProvider {};

class TestRemoteFactory
    : public blink::mojom::blink::RendererAudioOutputStreamFactory {};

class MockStream : public media::mojom::blink::AudioOutputStream {};

class MockDelegate : public media::AudioOutputIPCDelegate {};

}  // namespace

TEST(MojoAudioOutputIPC, AuthorizeWithoutFactory_CallsAuthorizedWithError) {}

TEST(MojoAudioOutputIPC,
     CreateWithoutAuthorizationWithoutFactory_CallsAuthorizedWithError) {}

TEST(MojoAudioOutputIPC, DeviceAuthorized_Propagates) {}

TEST(MojoAudioOutputIPC, OnDeviceCreated_Propagates) {}

TEST(MojoAudioOutputIPC,
     CreateWithoutAuthorization_RequestsAuthorizationFirst) {}

TEST(MojoAudioOutputIPC, IsReusable) {}

TEST(MojoAudioOutputIPC, IsReusableAfterError) {}

TEST(MojoAudioOutputIPC, DeviceNotAuthorized_Propagates) {}

TEST(MojoAudioOutputIPC,
     FactoryDisconnectedBeforeAuthorizationReply_CallsAuthorizedAnyways) {}

TEST(MojoAudioOutputIPC,
     FactoryDisconnectedAfterAuthorizationReply_CallsAuthorizedOnlyOnce) {}

TEST(MojoAudioOutputIPC, AuthorizeNoClose_DCHECKs) {}

TEST(MojoAudioOutputIPC, CreateNoClose_DCHECKs) {}

TEST(MojoAudioOutputIPC, Play_Plays) {}

TEST(MojoAudioOutputIPC, Pause_Pauses) {}

TEST(MojoAudioOutputIPC, SetVolume_SetsVolume) {}

}  // namespace blink