| Index: third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp
|
| diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp
|
| index 1ac69d0b1cce03fcc135183c5d624f5800cee074..43dcac1f1b89bbb6513a3df6b3b6c774d4e3bae7 100644
|
| --- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp
|
| +++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp
|
| @@ -72,3 +72,21 @@ TEST(MediaTrackConstraintsTest, ConstraintName)
|
| blink::BooleanConstraint boolConstraint(theName);
|
| EXPECT_EQ(theName, boolConstraint.name());
|
| }
|
| +
|
| +TEST(MediaTrackConstraintsTest, MandatoryChecks)
|
| +{
|
| + blink::WebMediaTrackConstraintSet theSet;
|
| + std::string foundName;
|
| + EXPECT_FALSE(theSet.hasMandatory());
|
| + EXPECT_FALSE(theSet.hasMandatoryOutsideSet({ "width" }, foundName));
|
| + EXPECT_FALSE(theSet.width.hasMandatory());
|
| + theSet.width.setMax(240);
|
| + EXPECT_TRUE(theSet.width.hasMandatory());
|
| + EXPECT_TRUE(theSet.hasMandatory());
|
| + EXPECT_FALSE(theSet.hasMandatoryOutsideSet({ "width" }, foundName));
|
| + EXPECT_TRUE(theSet.hasMandatoryOutsideSet({ "height" }, foundName));
|
| + EXPECT_EQ("width", foundName);
|
| + theSet.googPayloadPadding.setExact(true);
|
| + EXPECT_TRUE(theSet.hasMandatoryOutsideSet({ "width" }, foundName));
|
| + EXPECT_EQ("googPayloadPadding", foundName);
|
| +}
|
|
|