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

Unified Diff: third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp

Issue 2483703002: Replicate feature policy headers to remote frames (Closed)
Patch Set: Addressing review comments Created 4 years, 1 month 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/core/frame/FeaturePolicyInFrameTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp b/third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp
index e14e5f33fd7b8201f0dc4c5e21d4cd3b2ecc7e2b..f9375547350c107c1521230fb5f05012edc7da49 100644
--- a/third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp
+++ b/third_party/WebKit/Source/core/frame/FeaturePolicyInFrameTest.cpp
@@ -77,7 +77,7 @@ class FeaturePolicyInFrameTest : public ::testing::Test {
TEST_F(FeaturePolicyInFrameTest, TestFeatureDefaultsInTopLevelFrame) {
std::unique_ptr<FeaturePolicy> policy1 =
createFromParentPolicy(nullptr, m_originA);
- document().setFeaturePolicy(std::move(policy1));
+ document().setFeaturePolicyForTesting(std::move(policy1));
EXPECT_TRUE(isFeatureEnabledInFrame(kDefaultOnFeature, frame()));
EXPECT_TRUE(isFeatureEnabledInFrame(kDefaultSelfFeature, frame()));
EXPECT_FALSE(isFeatureEnabledInFrame(kDefaultOffFeature, frame()));
@@ -88,7 +88,7 @@ TEST_F(FeaturePolicyInFrameTest, TestFeatureDefaultsInCrossOriginFrame) {
createFromParentPolicy(nullptr, m_originB);
std::unique_ptr<FeaturePolicy> policy2 =
createFromParentPolicy(policy1.get(), m_originA);
- document().setFeaturePolicy(std::move(policy2));
+ document().setFeaturePolicyForTesting(std::move(policy2));
EXPECT_TRUE(isFeatureEnabledInFrame(kDefaultOnFeature, frame()));
EXPECT_FALSE(isFeatureEnabledInFrame(kDefaultSelfFeature, frame()));
EXPECT_FALSE(isFeatureEnabledInFrame(kDefaultOffFeature, frame()));
@@ -99,9 +99,9 @@ TEST_F(FeaturePolicyInFrameTest, TestFeatureOverriddenInFrame) {
std::unique_ptr<FeaturePolicy> policy1 =
createFromParentPolicy(nullptr, m_originA);
policy1->setHeaderPolicy("{\"default-off\": [\"self\"], \"default-on\": []}",
- messages);
+ &messages);
EXPECT_EQ(0UL, messages.size());
- document().setFeaturePolicy(std::move(policy1));
+ document().setFeaturePolicyForTesting(std::move(policy1));
EXPECT_TRUE(isFeatureEnabledInFrame(kDefaultOffFeature, frame()));
EXPECT_FALSE(isFeatureEnabledInFrame(kDefaultOnFeature, frame()));
}
@@ -122,9 +122,9 @@ TEST_F(FeaturePolicyInFrameTest, TestPolicyInactiveWhenFPDisabled) {
Vector<String> messages;
std::unique_ptr<FeaturePolicy> policy1 =
createFromParentPolicy(nullptr, m_originA);
- policy1->setHeaderPolicy("{\"default-on\": []}", messages);
+ policy1->setHeaderPolicy("{\"default-on\": []}", &messages);
EXPECT_EQ(0UL, messages.size());
- document().setFeaturePolicy(std::move(policy1));
+ document().setFeaturePolicyForTesting(std::move(policy1));
EXPECT_TRUE(isFeatureEnabledInFrame(kDefaultOnFeature, frame()));
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/SecurityContext.cpp ('k') | third_party/WebKit/Source/core/loader/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698