#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 {
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) { … }
}
class MediaStreamConstraintsUtilVideoContentTest : public testing::Test { … };
TEST_F(MediaStreamConstraintsUtilVideoContentTest, Unconstrained) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest, OverconstrainedOnHeight) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest, OverconstrainedOnWidth) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest,
OverconstrainedOnAspectRatio) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest, OverconstrainedOnFrameRate) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest,
OverconstrainedOnInvalidResizeMode) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest,
OverconstrainedOnEmptyResizeMode) { … }
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) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest,
AdvancedMinMaxResolutionFrameRate) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest, AdvancedExactResolution) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest,
AdvancedResolutionAndFrameRate) { … }
TEST_F(MediaStreamConstraintsUtilVideoContentTest, AdvancedNoiseReduction) { … }
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) { … }
}
}