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

Side by Side Diff: Source/core/frame/csp/ContentSecurityPolicyTest.cpp

Issue 983533005: Upgrade insecure request: Drop the reporting functionality. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "config.h" 5 #include "config.h"
6 #include "core/frame/csp/ContentSecurityPolicy.h" 6 #include "core/frame/csp/ContentSecurityPolicy.h"
7 7
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/loader/DocumentLoader.h" 9 #include "core/loader/DocumentLoader.h"
10 #include "platform/RuntimeEnabledFeatures.h" 10 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 EXPECT_EQ(SecurityContext::InsecureContentDoNotUpgrade, csp->insecureContent Policy()); 65 EXPECT_EQ(SecurityContext::InsecureContentDoNotUpgrade, csp->insecureContent Policy());
66 66
67 csp->bindToExecutionContext(document.get()); 67 csp->bindToExecutionContext(document.get());
68 EXPECT_EQ(SecurityContext::InsecureContentDoNotUpgrade, document->insecureCo ntentPolicy()); 68 EXPECT_EQ(SecurityContext::InsecureContentDoNotUpgrade, document->insecureCo ntentPolicy());
69 } 69 }
70 70
71 TEST_F(ContentSecurityPolicyTest, ParseMonitorInsecureRequestsEnabled) 71 TEST_F(ContentSecurityPolicyTest, ParseMonitorInsecureRequestsEnabled)
72 { 72 {
73 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled( true); 73 RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled( true);
74 csp->didReceiveHeader("upgrade-insecure-requests", ContentSecurityPolicyHead erTypeReport, ContentSecurityPolicyHeaderSourceHTTP); 74 csp->didReceiveHeader("upgrade-insecure-requests", ContentSecurityPolicyHead erTypeReport, ContentSecurityPolicyHeaderSourceHTTP);
75 EXPECT_EQ(SecurityContext::InsecureContentMonitor, csp->insecureContentPolic y()); 75 EXPECT_EQ(SecurityContext::InsecureContentDoNotUpgrade, csp->insecureContent Policy());
Yoav Weiss 2015/03/05 12:31:34 So in this case, we would also have an invalid pol
76 76
77 csp->bindToExecutionContext(document.get()); 77 csp->bindToExecutionContext(document.get());
78 EXPECT_EQ(SecurityContext::InsecureContentMonitor, document->insecureContent Policy()); 78 EXPECT_EQ(SecurityContext::InsecureContentDoNotUpgrade, document->insecureCo ntentPolicy());
79 } 79 }
80 80
81 } // namespace 81 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698