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

Unified Diff: third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp

Issue 2923563003: Move container policy logic to frame owner classes. (Closed)
Patch Set: Addressing nits Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1e3b9f90998c6be10dca3aed9dd010fba7192b0e..b71ebca2ba46694d555ceab9ed6d5392856dc1c0 100644
--- a/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
+++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
@@ -124,80 +124,4 @@ TEST_F(FeaturePolicyTest, PolicyParsedCorrectly) {
parsed_policy[2].origins[0].Get()));
}
-TEST_F(FeaturePolicyTest, ParseEmptyContainerPolicy) {
- WebParsedFeaturePolicy container_policy =
- GetContainerPolicyFromAllowedFeatures(
- std::vector<WebFeaturePolicyFeature>({}), false, false,
- origin_a_.Get());
- EXPECT_EQ(0UL, container_policy.size());
-}
-
-TEST_F(FeaturePolicyTest, ParseContainerPolicy) {
- WebParsedFeaturePolicy container_policy =
- GetContainerPolicyFromAllowedFeatures(
- std::vector<WebFeaturePolicyFeature>(
- {WebFeaturePolicyFeature::kVibrate,
- WebFeaturePolicyFeature::kPayment}),
- 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);
- EXPECT_EQ(1UL, container_policy[0].origins.size());
- EXPECT_TRUE(origin_a_->IsSameSchemeHostPortAndSuborigin(
- container_policy[0].origins[0].Get()));
- EXPECT_EQ(WebFeaturePolicyFeature::kPayment, container_policy[1].feature);
- EXPECT_FALSE(container_policy[1].matches_all_origins);
- EXPECT_EQ(1UL, container_policy[1].origins.size());
- EXPECT_TRUE(origin_a_->IsSameSchemeHostPortAndSuborigin(
- container_policy[1].origins[0].Get()));
-}
-
-TEST_F(FeaturePolicyTest, ParseContainerPolicyWithAllowFullscreen) {
- WebParsedFeaturePolicy container_policy =
- GetContainerPolicyFromAllowedFeatures(
- std::vector<WebFeaturePolicyFeature>({}), true, false,
- origin_a_.Get());
- EXPECT_EQ(1UL, container_policy.size());
- EXPECT_EQ(WebFeaturePolicyFeature::kFullscreen, container_policy[0].feature);
- EXPECT_TRUE(container_policy[0].matches_all_origins);
-}
-
-TEST_F(FeaturePolicyTest, ParseContainerPolicyWithAllowPaymentRequest) {
- WebParsedFeaturePolicy container_policy =
- GetContainerPolicyFromAllowedFeatures(
- std::vector<WebFeaturePolicyFeature>(
- {WebFeaturePolicyFeature::kVibrate}),
- false, true, 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);
- EXPECT_EQ(1UL, container_policy[0].origins.size());
- EXPECT_TRUE(origin_a_->IsSameSchemeHostPortAndSuborigin(
- container_policy[0].origins[0].Get()));
- EXPECT_EQ(WebFeaturePolicyFeature::kPayment, container_policy[1].feature);
- EXPECT_TRUE(container_policy[1].matches_all_origins);
-}
-
-TEST_F(FeaturePolicyTest, ParseContainerPolicyWithAllowAttributes) {
- 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::kVibrate, 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::kPayment, container_policy[1].feature);
- EXPECT_FALSE(container_policy[1].matches_all_origins);
- EXPECT_EQ(1UL, container_policy[1].origins.size());
- EXPECT_TRUE(origin_a_->IsSameSchemeHostPortAndSuborigin(
- container_policy[1].origins[0].Get()));
- EXPECT_EQ(WebFeaturePolicyFeature::kFullscreen, container_policy[2].feature);
- EXPECT_TRUE(container_policy[2].matches_all_origins);
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698