chromium/content/browser/renderer_host/media/video_capture_unittest.cc

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

#include <stdint.h>

#include <map>
#include <memory>
#include <string>

#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/test_future.h"
#include "build/build_config.h"
#include "content/browser/media/media_devices_util.h"
#include "content/browser/renderer_host/media/fake_video_capture_provider.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/renderer_host/media/media_stream_ui_proxy.h"
#include "content/browser/renderer_host/media/video_capture_host.h"
#include "content/browser/renderer_host/media/video_capture_manager.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_browser_context.h"
#include "content/test/test_content_browser_client.h"
#include "media/audio/audio_system_impl.h"
#include "media/audio/mock_audio_manager.h"
#include "media/audio/test_audio_thread.h"
#include "media/base/media_switches.h"
#include "media/capture/video_capture_types.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/mediastream/media_devices.h"

_;
AnyNumber;
AtMost;
DoAll;
InSequence;
Mock;
Return;
SaveArg;
StrictMock;

namespace content {

namespace {

void VideoInputDevicesEnumerated(
    base::OnceClosure quit_closure,
    const MediaDeviceSaltAndOrigin& salt_and_origin,
    blink::WebMediaDeviceInfoArray* out,
    const MediaDeviceEnumeration& enumeration) {}

// Id used to identify the capture session between renderer and
// video_capture_host. This is an arbitrary value.
const base::UnguessableToken& DeviceId() {}

}  // namespace

ACTION_P2(ExitMessageLoop, task_runner, quit_closure) {}

class MockRenderFrameHostDelegate
    : public VideoCaptureHost::RenderFrameHostDelegate {};

// This is an integration test of VideoCaptureHost in conjunction with
// MediaStreamManager, VideoCaptureManager, VideoCaptureController, and
// VideoCaptureDevice.
class VideoCaptureTest : public testing::Test,
                         public media::mojom::VideoCaptureObserver {};

// Construct and destruct all objects. This is a non trivial sequence.
TEST_F(VideoCaptureTest, ConstructAndDestruct) {}

TEST_F(VideoCaptureTest, StartAndImmediateStop) {}

TEST_F(VideoCaptureTest, StartAndCaptureAndStop) {}

TEST_F(VideoCaptureTest, StartAndErrorAndStop) {}

TEST_F(VideoCaptureTest, StartWithInvalidSessionId) {}

TEST_F(VideoCaptureTest, StartAndCaptureAndError) {}

TEST_F(VideoCaptureTest, StartAndPauseAndResumeAndStop) {}

TEST_F(VideoCaptureTest, CloseSessionWithoutStopping) {}

// Tests if RenderProcessHostDelegate methods are called as often as as
// expected.
TEST_F(VideoCaptureTest, IncrementMatchesDecrementCalls) {}

TEST_F(VideoCaptureTest, RegisterAndUnregisterWithMediaStreamManager) {}

}  // namespace content