#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_sets.h"
#include <cmath>
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_track.h"
#include "third_party/blink/renderer/modules/mediastream/mock_constraint_factory.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
namespace media_constraints {
ResolutionSet;
Point;
BoolSet;
namespace {
const int kDefaultWidth = …;
const int kDefaultHeight = …;
constexpr double kDefaultAspectRatio = …;
#define EXPECT_POINT_EQ(p1, p2) …
void VerticesContain(const Vector<Point>& vertices, const Point& point) { … }
bool AreCounterclockwise(const Vector<Point>& vertices) { … }
bool AreValidVertices(const ResolutionSet& set, const Vector<Point>& vertices) { … }
Point ProjectionOnSegmentLine(const Point& point,
const Point& s1,
const Point& s2) { … }
}
class MediaStreamConstraintsUtilSetsTest : public testing::Test { … };
TEST_F(MediaStreamConstraintsUtilSetsTest, VertexListValidity) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, PointOperations) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionUnconstrained) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionConstrained) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionTrivialEmptiness) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionLineConstraintsEmptiness) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionBoxEmptiness) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionPointIntersection) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionLineIntersection) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionBoxIntersection) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionPointSetClosestPoint) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionLineSetClosestPoint) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionGeneralSetClosestPoint) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionIdealIntersects) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionIdealOutsideSinglePoint) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest,
ResolutionIdealOutsideMultiplePoints) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest,
ResolutionUnconstrainedExtremeIdeal) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ResolutionVertices) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ExactResolution) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, ZeroExactResolution) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, NumericRangeSetDouble) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, NumericRangeSetFromConstraint) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest,
NumericRangeSetFromConstraintWithBounds) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, NumericRangeSetFromValue) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, DiscreteSetString) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, DiscreteSetBool) { … }
TEST_F(MediaStreamConstraintsUtilSetsTest, RescaleSetFromConstraints) { … }
}
}