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

Unified Diff: Source/core/fetch/ResourceFetcherTest.cpp

Issue 978323002: Upgrade insecure requests: Pipe navigational hosts down into nested documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcherTest.cpp
diff --git a/Source/core/fetch/ResourceFetcherTest.cpp b/Source/core/fetch/ResourceFetcherTest.cpp
index f2ed228bcd6191885f06b1231729369f01510fa0..a935d446079a9d69630662f142e89bed1a53e10d 100644
--- a/Source/core/fetch/ResourceFetcherTest.cpp
+++ b/Source/core/fetch/ResourceFetcherTest.cpp
@@ -154,8 +154,7 @@ TEST_F(ResourceFetcherUpgradeTest, UpgradeInsecureResourceRequests)
document->setInsecureRequestsPolicy(SecurityContext::InsecureRequestsUpgrade);
for (auto test : tests) {
- // secureOrigin's host is 'secureorigin.test', not 'example.test'
- document->setSecurityOrigin(secureOrigin);
+ document->insecureNavigationsToUpgrade()->clear();
// We always upgrade for FrameTypeNone and FrameTypeNested.
expectUpgrade(test.original, WebURLRequest::RequestContextScript, WebURLRequest::FrameTypeNone, test.upgraded);
@@ -169,8 +168,8 @@ TEST_F(ResourceFetcherUpgradeTest, UpgradeInsecureResourceRequests)
expectUpgrade(test.original, WebURLRequest::RequestContextForm, WebURLRequest::FrameTypeTopLevel, test.upgraded);
expectUpgrade(test.original, WebURLRequest::RequestContextForm, WebURLRequest::FrameTypeAuxiliary, test.upgraded);
- // Or unless the host of the document matches the host of the resource:
- document->setSecurityOrigin(exampleOrigin);
+ // Or unless the host of the resource is in the document's InsecureNavigationsSet:
+ document->addInsecureNavigationUpgrade(exampleOrigin->host());
expectUpgrade(test.original, WebURLRequest::RequestContextScript, WebURLRequest::FrameTypeTopLevel, test.upgraded);
expectUpgrade(test.original, WebURLRequest::RequestContextScript, WebURLRequest::FrameTypeAuxiliary, test.upgraded);
}
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698