chromium/third_party/blink/renderer/modules/webaudio/audio_context_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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/modules/webaudio/audio_context.h"

#include <memory>

#include "base/synchronization/waitable_event.h"
#include "media/base/audio_timestamp_helper.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/remote_set.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/frame/lifecycle.mojom-blink.h"
#include "third_party/blink/public/mojom/media/capture_handle_config.mojom-blink.h"
#include "third_party/blink/public/platform/web_audio_device.h"
#include "third_party/blink/public/platform/web_audio_latency_hint.h"
#include "third_party/blink/public/platform/web_audio_sink_descriptor.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_audio_sink_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_audiocontextlatencycategory_double.h"
#include "third_party/blink/renderer/core/core_initializer.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
#include "third_party/blink/renderer/modules/mediastream/sub_capture_target.h"
#include "third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.h"
#include "third_party/blink/renderer/modules/webaudio/audio_playout_stats.h"
#include "third_party/blink/renderer/modules/webaudio/realtime_audio_destination_node.h"
#include "third_party/blink/renderer/modules/webrtc/webrtc_audio_device_impl.h"
#include "third_party/blink/renderer/platform/scheduler/public/event_loop.h"
#include "third_party/blink/renderer/platform/scheduler/public/non_main_thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/blink/renderer/platform/testing/scoped_mocked_url.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_media.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"

namespace blink {

namespace {

constexpr char kFakeAudioOutput1[] =;
constexpr char kFakeAudioOutput2[] =;
constexpr char kInvalidAudioOutput[] =;
constexpr char kSecurityOrigin[] =;
constexpr char kTestData[] =;
constexpr char kDefaultDeviceId[] =;

bool web_audio_device_paused_;

class MockMediaDevicesDispatcherHost final
    : public mojom::blink::MediaDevicesDispatcherHost {};

class MockWebAudioDeviceForAudioContext : public WebAudioDevice {};

class AudioContextTestPlatform : public TestingPlatformSupport {};

String GetAecDevice(ExecutionContext* execution_context) {}

}  // namespace

class AudioContextTest : public PageTestBase {};

TEST_F(AudioContextTest, AudioContextOptions_WebAudioLatencyHint) {}

TEST_F(AudioContextTest, AudioContextAudibility_ServiceUnbind) {}

TEST_F(AudioContextTest, ExecutionContextPaused) {}

// Test initialization/uninitialization of MediaDeviceService.
TEST_F(AudioContextTest, MediaDevicesService) {}

TEST_F(AudioContextTest, OnRenderErrorFromPlatformDestination) {}

class ContextRenderer : public GarbageCollected<ContextRenderer> {};

TEST_F(AudioContextTest, PlayoutStats) {}

TEST_F(AudioContextTest, ChannelCountRunning) {}

TEST_F(AudioContextTest, ChannelCountSuspended) {}

TEST_F(AudioContextTest, SetSinkIdRunning) {}

TEST_F(AudioContextTest, SetSinkIdSuspended) {}

TEST_F(AudioContextTest, AecConstructor) {}

TEST_F(AudioContextTest, AecSetSinkIdSuspended) {}

TEST_F(AudioContextTest, AecSetSinkIdMultiple) {}

TEST_F(AudioContextTest, AecSetSinkIdAfterConstructor) {}

}  // namespace blink