#include "third_party/blink/renderer/modules/webaudio/audio_context.h"
#include <memory>
#include "base/test/metrics/histogram_tester.h"
#include "build/build_config.h"
#include "media/base/output_device_info.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.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/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_audio_context_options.h"
#include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
#include "third_party/blink/renderer/core/frame/frame_types.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/frame/settings.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html/media/autoplay_policy.h"
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/platform/loader/fetch/memory_cache.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/testing/testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
namespace blink {
namespace {
const char* const kAutoplayMetric = …;
const char* const kAutoplayCrossOriginMetric = …;
class MockWebAudioDeviceForAutoplayTest : public WebAudioDevice { … };
class AudioContextAutoplayTestPlatform : public TestingPlatformSupport { … };
}
class AudioContextAutoplayTest
: public testing::TestWithParam<AutoplayPolicy::Type> { … };
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_CreateNoGesture_Child) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_CreateNoGesture_Main) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_CallResumeNoGesture_Child) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_CallResumeNoGesture_Main) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_CreateGesture_Child) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_CreateGesture_Main) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_CallResumeGesture_Child) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_CallResumeGesture_Main) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_NodeStartNoGesture_Child) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_NodeStartNoGesture_Main) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_NodeStartGesture_Child) { … }
TEST_P(AudioContextAutoplayTest, AutoplayMetrics_NodeStartGesture_Main) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_NodeStartNoGestureThenSuccess_Child) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_NodeStartNoGestureThenSuccess_Main) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_NodeStartGestureThenSucces_Child) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_NodeStartGestureThenSucces_Main) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_DocumentReceivedGesture_Child) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_DocumentReceivedGesture_Main) { … }
TEST_P(AudioContextAutoplayTest,
AutoplayMetrics_DocumentReceivedGesture_BeforeNavigation) { … }
INSTANTIATE_TEST_SUITE_P(…);
}