Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(791)

Unified Diff: third_party/WebKit/Source/modules/mediastream/MediaConstraintsTest.cpp

Issue 1617243005: Apply new-style constraints to video_source. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+}
« no previous file with comments | « content/test/data/media/getusermedia.html ('k') | third_party/WebKit/Source/platform/exported/WebMediaConstraints.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698