chromium/content/browser/renderer_host/media/video_capture_browsertest.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 "base/command_line.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/browser/browser_main_loop.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/renderer_host/media/video_capture_controller.h"
#include "content/browser/renderer_host/media/video_capture_manager.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/content_browser_test.h"
#include "media/base/media_switches.h"
#include "media/capture/video_capture_types.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "url/origin.h"

#if BUILDFLAG(IS_MAC)
#include "base/mac/mac_util.h"
#endif

_;
AtLeast;
Bool;
Combine;
Invoke;
InvokeWithoutArgs;
Values;

namespace content {

static const char kFakeDeviceFactoryConfigString[] =;
static const float kFrameRateToRequest =;

class MockVideoCaptureControllerEventHandler
    : public VideoCaptureControllerEventHandler {};

class MockMediaStreamProviderListener : public MediaStreamProviderListener {};

DeviceIndex;
Resolution;
ExerciseAcceleratedJpegDecoding;

// For converting the std::tuple<> used as test parameters back to something
// human-readable.
struct TestParams {};

struct FrameInfo {};

// Integration test that exercises the VideoCaptureManager instance running in
// the Browser process.
class VideoCaptureBrowserTest
    : public ContentBrowserTest,
      public ::testing::WithParamInterface<
          std::
              tuple<DeviceIndex, Resolution, ExerciseAcceleratedJpegDecoding>> {};

IN_PROC_BROWSER_TEST_P(VideoCaptureBrowserTest, StartAndImmediatelyStop) {}

// Flaky on MSAN. https://crbug.com/840294
#if defined(MEMORY_SANITIZER) || BUILDFLAG(IS_MAC)
#define MAYBE_ReceiveFramesFromFakeCaptureDevice
#else
#define MAYBE_ReceiveFramesFromFakeCaptureDevice
#endif
IN_PROC_BROWSER_TEST_P(VideoCaptureBrowserTest,
                       MAYBE_ReceiveFramesFromFakeCaptureDevice) {}

INSTANTIATE_TEST_SUITE_P();  // ExerciseAcceleratedJpegDecoding

}  // namespace content