chromium/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_content_test.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 "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_content.h"

#include <cmath>
#include <string>

#include "media/base/limits.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/modules/mediastream/web_platform_media_stream_source.h"
#include "third_party/blink/renderer/modules/mediastream/media_constraints.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.h"
#include "third_party/blink/renderer/modules/mediastream/mock_constraint_factory.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"

namespace blink {

// To avoid symbol collisions in jumbo builds.
namespace media_stream_constraints_util_video_content_test {

namespace {

const double kDefaultScreenCastAspectRatio =;

void CheckNonResolutionDefaults(const VideoCaptureSettings& result) {}

void CheckNonFrameRateDefaults(const VideoCaptureSettings& result) {}

void CheckTrackAdapterSettingsEqualsFormat(
    const VideoCaptureSettings& result,
    std::optional<double> frame_rate = std::nullopt) {}

void CheckTrackAdapterSettingsEqualsFormatDefaultAspectRatio(
    const VideoCaptureSettings& result,
    std::optional<double> frame_rate = std::nullopt) {}

}  // namespace

class MediaStreamConstraintsUtilVideoContentTest : public testing::Test {};

// The Unconstrained test checks the default selection criteria.
TEST_F(MediaStreamConstraintsUtilVideoContentTest, Unconstrained) {}

// The "Overconstrained" tests verify that failure of any single required
// constraint results in failure to select a candidate.
TEST_F(MediaStreamConstraintsUtilVideoContentTest, OverconstrainedOnHeight) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, OverconstrainedOnWidth) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       OverconstrainedOnAspectRatio) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, OverconstrainedOnFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       OverconstrainedOnInvalidResizeMode) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       OverconstrainedOnEmptyResizeMode) {}

// The "Mandatory" and "Ideal" tests check that various selection criteria work
// for each individual constraint in the basic constraint set.
TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryDeviceID) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, IdealDeviceID) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryNoiseReduction) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, IdealNoiseReduction) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryExactHeight) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMinHeight) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMaxHeight) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryHeightRange) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, IdealHeight) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryExactWidth) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMinWidth) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMaxWidth) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryWidthRange) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, IdealWidth) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryExactAspectRatio) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMinAspectRatio) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMaxAspectRatio) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryRangeAspectRatio) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, IdealAspectRatio) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryExactFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMinFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryMaxFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryRangeFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, IdealFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, MandatoryResizeMode) {}

// The "Advanced" tests check selection criteria involving advanced constraint
// sets.
TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedMinMaxResolutionFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, AdvancedExactResolution) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedResolutionAndFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, AdvancedNoiseReduction) {}

// The "AdvancedContradictory" tests check that advanced constraint sets that
// contradict previous constraint sets are ignored.
TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryNoiseReduction) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryExactResolution) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryMaxMinResolutionFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryMinMaxResolutionFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryExactAspectRatio) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryAspectRatioRange) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryExactFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryFrameRateRange) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryWidthFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryHeightFrameRate) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, AdvancedDeviceID) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest,
       AdvancedContradictoryDeviceID) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, AdvancedIdealDeviceID) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, AdvancedResizeMode) {}

TEST_F(MediaStreamConstraintsUtilVideoContentTest, ResolutionChangePolicy) {}

}  // namespace media_stream_constraints_util_video_content_test
}  // namespace blink