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

Unified Diff: Source/core/loader/FrameFetchContextTest.cpp

Issue 1022093002: Upgrade: Drop the 'upgraded' signal, expand the 'https' signal. (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
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameFetchContextTest.cpp
diff --git a/Source/core/loader/FrameFetchContextTest.cpp b/Source/core/loader/FrameFetchContextTest.cpp
index 91ac63d01d1e4dc3e06809ea4dfabebf4ebff804..1b40742be079f283ae2dc4427197b7e6762ee610 100644
--- a/Source/core/loader/FrameFetchContextTest.cpp
+++ b/Source/core/loader/FrameFetchContextTest.cpp
@@ -85,14 +85,9 @@ protected:
EXPECT_EQ(expectedURL.port(), fetchRequest.resourceRequest().url().port());
EXPECT_EQ(expectedURL.hasPort(), fetchRequest.resourceRequest().url().hasPort());
EXPECT_EQ(expectedURL.path(), fetchRequest.resourceRequest().url().path());
-
- bool expectUpgrade = inputURL != expectedURL;
-
- EXPECT_STREQ(expectUpgrade ? "1" : "",
- fetchRequest.resourceRequest().httpHeaderField("Upgraded").utf8().data());
}
- void expectPreferHeader(const char* input, WebURLRequest::FrameType frameType, bool shouldPrefer)
+ void expectHTTPSHeader(const char* input, WebURLRequest::FrameType frameType, bool shouldPrefer)
{
KURL inputURL(ParsedURLString, input);
@@ -102,8 +97,8 @@ protected:
fetchContext->upgradeInsecureRequest(fetchRequest);
- EXPECT_STREQ(shouldPrefer ? "tls" : "",
- fetchRequest.resourceRequest().httpHeaderField("Prefer").utf8().data());
+ EXPECT_STREQ(shouldPrefer ? "1" : "",
+ fetchRequest.resourceRequest().httpHeaderField("HTTPS").utf8().data());
}
KURL secureURL;
@@ -190,18 +185,18 @@ TEST_F(FrameFetchContextUpgradeTest, SendPreferHeader)
{ "http://example.test/page.html", WebURLRequest::FrameTypeNested, true },
{ "http://example.test/page.html", WebURLRequest::FrameTypeNone, false },
{ "http://example.test/page.html", WebURLRequest::FrameTypeTopLevel, true },
- { "https://example.test/page.html", WebURLRequest::FrameTypeAuxiliary, false },
- { "https://example.test/page.html", WebURLRequest::FrameTypeNested, false },
+ { "https://example.test/page.html", WebURLRequest::FrameTypeAuxiliary, true },
+ { "https://example.test/page.html", WebURLRequest::FrameTypeNested, true },
{ "https://example.test/page.html", WebURLRequest::FrameTypeNone, false },
- { "https://example.test/page.html", WebURLRequest::FrameTypeTopLevel, false }
+ { "https://example.test/page.html", WebURLRequest::FrameTypeTopLevel, true }
};
for (auto test : tests) {
document->setInsecureRequestsPolicy(SecurityContext::InsecureRequestsDoNotUpgrade);
- expectPreferHeader(test.toRequest, test.frameType, test.shouldPrefer);
+ expectHTTPSHeader(test.toRequest, test.frameType, test.shouldPrefer);
document->setInsecureRequestsPolicy(SecurityContext::InsecureRequestsUpgrade);
- expectPreferHeader(test.toRequest, test.frameType, test.shouldPrefer);
+ expectHTTPSHeader(test.toRequest, test.frameType, test.shouldPrefer);
}
}
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698