OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |