Index: third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp |
diff --git a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp |
index f3dfdb035398e808810f1ab2726435ed3d683922..38957c9c56bcd6a631f218618f1bd292414002e3 100644 |
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp |
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp |
@@ -127,7 +127,8 @@ TEST_F(FeaturePolicyTest, PolicyParsedCorrectly) { |
TEST_F(FeaturePolicyTest, ParseEmptyContainerPolicy) { |
WebParsedFeaturePolicy container_policy = |
GetContainerPolicyFromAllowedFeatures( |
- std::vector<WebFeaturePolicyFeature>({}), origin_a_.Get()); |
+ std::vector<WebFeaturePolicyFeature>({}), false, false, |
+ origin_a_.Get()); |
EXPECT_EQ(0UL, container_policy.size()); |
} |
@@ -137,7 +138,7 @@ TEST_F(FeaturePolicyTest, ParseContainerPolicy) { |
std::vector<WebFeaturePolicyFeature>( |
{WebFeaturePolicyFeature::kVibrate, |
WebFeaturePolicyFeature::kPayment}), |
- origin_a_.Get()); |
+ false, false, origin_a_.Get()); |
EXPECT_EQ(2UL, container_policy.size()); |
EXPECT_EQ(WebFeaturePolicyFeature::kVibrate, container_policy[0].feature); |
EXPECT_FALSE(container_policy[0].matches_all_origins); |
@@ -151,4 +152,26 @@ TEST_F(FeaturePolicyTest, ParseContainerPolicy) { |
container_policy[1].origins[0].Get())); |
} |
+TEST_F(FeaturePolicyTest, ParseContainerPolicyWithAllowAttributes) { |
iclelland
2017/04/25 17:19:55
Can you add two more similar tests here? One where
|
+ WebParsedFeaturePolicy container_policy = |
+ GetContainerPolicyFromAllowedFeatures( |
+ std::vector<WebFeaturePolicyFeature>( |
+ {WebFeaturePolicyFeature::kVibrate, |
+ WebFeaturePolicyFeature::kPayment}), |
+ true, true, origin_a_.Get()); |
+ EXPECT_EQ(3UL, container_policy.size()); |
+ EXPECT_EQ(WebFeaturePolicyFeature::kPayment, container_policy[0].feature); |
+ EXPECT_FALSE(container_policy[0].matches_all_origins); |
+ EXPECT_EQ(1UL, container_policy[0].origins.size()); |
+ EXPECT_TRUE(origin_a_->IsSameSchemeHostPortAndSuborigin( |
+ container_policy[0].origins[0].Get())); |
+ EXPECT_EQ(WebFeaturePolicyFeature::kFullscreen, container_policy[1].feature); |
+ EXPECT_TRUE(container_policy[1].matches_all_origins); |
+ EXPECT_EQ(WebFeaturePolicyFeature::kVibrate, container_policy[2].feature); |
+ EXPECT_FALSE(container_policy[2].matches_all_origins); |
+ EXPECT_EQ(1UL, container_policy[2].origins.size()); |
+ EXPECT_TRUE(origin_a_->IsSameSchemeHostPortAndSuborigin( |
+ container_policy[2].origins[0].Get())); |
+} |
+ |
} // namespace blink |