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

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

#include <utility>

#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/limits.h"
#include "media/base/video_frame.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom-blink.h"
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h"
#include "third_party/blink/public/web/web_heap.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/renderer/modules/mediastream/mock_constraint_factory.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_sink.h"
#include "third_party/blink/renderer/modules/mediastream/mock_media_stream_video_source.h"
#include "third_party/blink/renderer/modules/mediastream/video_track_adapter.h"
#include "third_party/blink/renderer/modules/mediastream/video_track_adapter_settings.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"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

_;
DoAll;
InSequence;
Mock;
Return;
SaveArg;

namespace blink {

const double kSourceFrameRate =;

class MediaStreamVideoSourceTest : public testing::Test {};

TEST_F(MediaStreamVideoSourceTest, AddTrackAndStartSource) {}

TEST_F(MediaStreamVideoSourceTest, AddTwoTracksBeforeSourceStarts) {}

TEST_F(MediaStreamVideoSourceTest, AddTrackAfterSourceStarts) {}

TEST_F(MediaStreamVideoSourceTest, AddTrackAndFailToStartSource) {}

TEST_F(MediaStreamVideoSourceTest, MandatoryAspectRatio4To3) {}

TEST_F(MediaStreamVideoSourceTest, ReleaseTrackAndSourceOnSuccessCallBack) {}

TEST_F(MediaStreamVideoSourceTest, TwoTracksWithVGAAndWVGA) {}

TEST_F(MediaStreamVideoSourceTest, TwoTracksWith720AndWVGA) {}

TEST_F(MediaStreamVideoSourceTest, SourceChangeFrameSize) {}

TEST_F(MediaStreamVideoSourceTest, RotatedSourceDetectionDisabled) {}

TEST_F(MediaStreamVideoSourceTest, RotatedSourceDetectionEnabled) {}

// Test that a source producing no frames change the source ReadyState to muted.
// that in a reasonable time frame the muted state turns to false.
TEST_F(MediaStreamVideoSourceTest, MutedSource) {}

// This test ensures that the filter used by the VideoTrackAdapter to estimate
// the frame rate is initialized correctly and does not drop any frames from
// start but forwards all as intended.
TEST_F(MediaStreamVideoSourceTest,
       SendAtMaxRateAndExpectAllFramesToBeDelivered) {}

// This test verifies that a too high input frame rate triggers an
// OnNotifyFrameDropped() notification on the sink.
TEST_F(MediaStreamVideoSourceTest, NotifyFrameDroppedWhenStartAtTooHighRate) {}

// This test verifies that all frames are forwarded when sending starts at the
// specified max rate and that a frame sent too close in time related to the
// previous frame is dropped but that forwarding is then restored as soon as the
// spacing is normal again.
TEST_F(MediaStreamVideoSourceTest, ForwardsAtMaxFrameRateAndDropsWhenTooClose) {}

// This test verifies that a frame sent directly after a dropped frame will
// pass even if it is sent with a slightly too high rate related to the frame
// that was dropped. The frame should pass since the frame-rate calculation
// is be based on the last forwarded frame and not the dropped frame.
TEST_F(MediaStreamVideoSourceTest, DropFrameAtTooHighRateAndThenStopDropping) {}

TEST_F(MediaStreamVideoSourceTest, ReconfigureTrack) {}

TEST_F(MediaStreamVideoSourceTest, ReconfigureStoppedTrack) {}

// Test that restart fails on a source without restart support.
TEST_F(MediaStreamVideoSourceTest, FailedRestart) {}

// Test that restart succeeds on a source with restart support.
TEST_F(MediaStreamVideoSourceTest, SuccessfulRestart) {}

// Test that restart fails on a source without restart support.
TEST_F(MediaStreamVideoSourceTest, FailedRestartAfterStopForRestart) {}

TEST_F(MediaStreamVideoSourceTest, StartStopAndNotifyRestartSupported) {}

TEST_F(MediaStreamVideoSourceTest, StartStopAndNotifyRestartNotSupported) {}

TEST_F(MediaStreamVideoSourceTest, StopSuspendedTrack) {}

TEST_F(MediaStreamVideoSourceTest, AddTrackAfterStoppingSource) {}

TEST_F(MediaStreamVideoSourceTest, AddsEncodedSinkWhenEncodedConsumerAppears) {}

TEST_F(MediaStreamVideoSourceTest, AddsEncodedSinkWhenEncodedConsumersAppear) {}

TEST_F(MediaStreamVideoSourceTest,
       RemovesEncodedSinkWhenEncodedConsumerDisappears) {}

TEST_F(MediaStreamVideoSourceTest,
       RemovesEncodedSinkWhenEncodedConsumersDisappear) {}

TEST_F(MediaStreamVideoSourceTest, RemovesEncodedSinkWhenTrackStops) {}

TEST_F(MediaStreamVideoSourceTest, CapturingLinkSecureOnlyEncodedSinks) {}

TEST_F(MediaStreamVideoSourceTest, CapturingLinkSecureTracksAndEncodedSinks) {}

TEST_F(MediaStreamVideoSourceTest, CanDiscardAlpha) {}

TEST_F(MediaStreamVideoSourceTest, CanDiscardAlphaIfOtherSinksDiscard) {}

TEST_F(MediaStreamVideoSourceTest, CanDiscardAlphaMultipleTracks) {}

TEST_F(MediaStreamVideoSourceTest, ConfiguredFrameRate) {}

}  // namespace blink