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

Side by Side 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: Add <vector> include Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "public/platform/WebMediaConstraints.h" 5 #include "public/platform/WebMediaConstraints.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 // The MediaTrackConstraintsTest group tests the types declared in 8 // The MediaTrackConstraintsTest group tests the types declared in
9 // WebKit/public/platform/WebMediaConstraints.h 9 // WebKit/public/platform/WebMediaConstraints.h
10 TEST(MediaTrackConstraintsTest, LongConstraint) 10 TEST(MediaTrackConstraintsTest, LongConstraint)
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 theSet.echoCancellation.setExact(false); 65 theSet.echoCancellation.setExact(false);
66 EXPECT_FALSE(theSet.isEmpty()); 66 EXPECT_FALSE(theSet.isEmpty());
67 } 67 }
68 68
69 TEST(MediaTrackConstraintsTest, ConstraintName) 69 TEST(MediaTrackConstraintsTest, ConstraintName)
70 { 70 {
71 const char* theName = "name"; 71 const char* theName = "name";
72 blink::BooleanConstraint boolConstraint(theName); 72 blink::BooleanConstraint boolConstraint(theName);
73 EXPECT_EQ(theName, boolConstraint.name()); 73 EXPECT_EQ(theName, boolConstraint.name());
74 } 74 }
75
76 TEST(MediaTrackConstraintsTest, MandatoryChecks)
77 {
78 blink::WebMediaTrackConstraintSet theSet;
79 std::string foundName;
80 EXPECT_FALSE(theSet.hasMandatory());
81 EXPECT_FALSE(theSet.hasMandatoryOutsideSet({ "width" }, foundName));
82 EXPECT_FALSE(theSet.width.hasMandatory());
83 theSet.width.setMax(240);
84 EXPECT_TRUE(theSet.width.hasMandatory());
85 EXPECT_TRUE(theSet.hasMandatory());
86 EXPECT_FALSE(theSet.hasMandatoryOutsideSet({ "width" }, foundName));
87 EXPECT_TRUE(theSet.hasMandatoryOutsideSet({ "height" }, foundName));
88 EXPECT_EQ("width", foundName);
89 theSet.googPayloadPadding.setExact(true);
90 EXPECT_TRUE(theSet.hasMandatoryOutsideSet({ "width" }, foundName));
91 EXPECT_EQ("googPayloadPadding", foundName);
92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698