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

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

Issue 999473002: Revert of Upgrade insecure requests: Pipe navigational hosts down into nested documents. (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 side-by-side diff with in-line comments
Download patch
Index: Source/core/fetch/ResourceFetcherTest.cpp
diff --git a/Source/core/fetch/ResourceFetcherTest.cpp b/Source/core/fetch/ResourceFetcherTest.cpp
index a935d446079a9d69630662f142e89bed1a53e10d..f2ed228bcd6191885f06b1231729369f01510fa0 100644
--- a/Source/core/fetch/ResourceFetcherTest.cpp
+++ b/Source/core/fetch/ResourceFetcherTest.cpp
@@ -154,7 +154,8 @@
document->setInsecureRequestsPolicy(SecurityContext::InsecureRequestsUpgrade);
for (auto test : tests) {
- document->insecureNavigationsToUpgrade()->clear();
+ // secureOrigin's host is 'secureorigin.test', not 'example.test'
+ document->setSecurityOrigin(secureOrigin);
// We always upgrade for FrameTypeNone and FrameTypeNested.
expectUpgrade(test.original, WebURLRequest::RequestContextScript, WebURLRequest::FrameTypeNone, test.upgraded);
@@ -168,8 +169,8 @@
expectUpgrade(test.original, WebURLRequest::RequestContextForm, WebURLRequest::FrameTypeTopLevel, test.upgraded);
expectUpgrade(test.original, WebURLRequest::RequestContextForm, WebURLRequest::FrameTypeAuxiliary, test.upgraded);
- // Or unless the host of the resource is in the document's InsecureNavigationsSet:
- document->addInsecureNavigationUpgrade(exampleOrigin->host());
+ // Or unless the host of the document matches the host of the resource:
+ document->setSecurityOrigin(exampleOrigin);
expectUpgrade(test.original, WebURLRequest::RequestContextScript, WebURLRequest::FrameTypeTopLevel, test.upgraded);
expectUpgrade(test.original, WebURLRequest::RequestContextScript, WebURLRequest::FrameTypeAuxiliary, test.upgraded);
}

Powered by Google App Engine
This is Rietveld 408576698