chromium/third_party/blink/renderer/modules/mediastream/media_stream_track_transfer_test.cc

// Copyright 2022 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/task/single_thread_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_dom_exception.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/modules/mediastream/browser_capture_media_stream_track.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_track.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h"
#include "third_party/blink/renderer/modules/mediastream/mock_mojo_media_stream_dispatcher_host.h"
#include "third_party/blink/renderer/modules/mediastream/user_media_client.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_audio_source.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_source.h"
#include "third_party/blink/renderer/platform/testing/io_task_runner_testing_platform_support.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {
namespace {

mojom::blink::MediaDevicesDispatcherHost* UnusedMediaDevicesDispatcherHost() {}

void SignalSourceReady(
    WebPlatformMediaStreamSource::ConstraintsOnceCallback source_ready,
    WebPlatformMediaStreamSource* source) {}

// UserMediaProcessor with mocked CreateVideoSource and CreateAudioSource.
class MockUserMediaProcessor : public UserMediaProcessor {};

class UserMediaClientUnderTest : public UserMediaClient {};

// ScopedMockUserMediaClient creates and installs a temporary UserMediaClient in
// |window| when constructed and restores the original UserMediaClient when
// destroyed. Uses a MockMojoMediaStreamDispatcherHost and
// MockUserMediaProcessor.
class ScopedMockUserMediaClient {};

MediaStreamTrack::TransferredValues TransferredValuesTabCaptureVideo() {}

mojom::blink::StreamDevices DevicesTabCaptureVideo(
    base::UnguessableToken session_id) {}

TEST(MediaStreamTrackTransferTest, TabCaptureVideoFromTransferredStateBasic) {}

// TODO(crbug.com/1288839): implement and test transferred sub-capture-target
// version

TEST(MediaStreamTrackTransferTest, TabCaptureAudioFromTransferredState) {}

}  // namespace
}  // namespace blink