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

Unified Diff: third_party/WebKit/Source/platform/network/ResourceRequestTest.cpp

Issue 2053693002: WIP: Move 'Upgrade-Insecure-Requests' to the browser process. Base URL: https://chromium.googlesource.com/chromium/src.git@replicate
Patch Set: Rebase. :( Created 3 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
Index: third_party/WebKit/Source/platform/network/ResourceRequestTest.cpp
diff --git a/third_party/WebKit/Source/platform/network/ResourceRequestTest.cpp b/third_party/WebKit/Source/platform/network/ResourceRequestTest.cpp
index 3a21a378141dfd77c73cff7f1404aa1f7395735d..66305241f08be011013afcf7989452533b167290 100644
--- a/third_party/WebKit/Source/platform/network/ResourceRequestTest.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceRequestTest.cpp
@@ -4,14 +4,15 @@
#include "platform/network/ResourceRequest.h"
+#include <memory>
#include "platform/network/EncodedFormData.h"
#include "platform/weborigin/KURL.h"
#include "platform/weborigin/Referrer.h"
#include "public/platform/WebCachePolicy.h"
+#include "public/platform/WebInsecureRequestPolicy.h"
#include "public/platform/WebURLRequest.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "wtf/text/AtomicString.h"
-#include <memory>
namespace blink {
@@ -52,6 +53,7 @@ TEST(ResourceRequestTest, CrossThreadResourceRequestData) {
original.setFrameType(WebURLRequest::FrameTypeNested);
original.setHTTPReferrer(
Referrer("http://www.example.com/referrer.htm", ReferrerPolicyDefault));
+ original.setInsecureRequestPolicy(kUpgradeInsecureRequests);
EXPECT_STREQ("http://www.example.com/test.htm",
original.url().getString().utf8().data());
@@ -84,6 +86,7 @@ TEST(ResourceRequestTest, CrossThreadResourceRequestData) {
EXPECT_STREQ("http://www.example.com/referrer.htm",
original.httpReferrer().utf8().data());
EXPECT_EQ(ReferrerPolicyDefault, original.getReferrerPolicy());
+ EXPECT_EQ(kUpgradeInsecureRequests, original.getInsecureRequestPolicy());
std::unique_ptr<CrossThreadResourceRequestData> data1(original.copyData());
ResourceRequest copy1(data1.get());
@@ -116,6 +119,7 @@ TEST(ResourceRequestTest, CrossThreadResourceRequestData) {
EXPECT_STREQ("http://www.example.com/referrer.htm",
copy1.httpReferrer().utf8().data());
EXPECT_EQ(ReferrerPolicyDefault, copy1.getReferrerPolicy());
+ EXPECT_EQ(kUpgradeInsecureRequests, copy1.getInsecureRequestPolicy());
copy1.setAllowStoredCredentials(true);
copy1.setReportUploadProgress(true);
« no previous file with comments | « third_party/WebKit/Source/platform/network/ResourceRequest.cpp ('k') | third_party/WebKit/public/platform/WebURLRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698