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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp

Issue 2053693002: WIP: Move 'Upgrade-Insecure-Requests' to the browser process. Base URL: https://chromium.googlesource.com/chromium/src.git@replicate
Patch Set: DCHECK. Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015, Google Inc. All rights reserved. 2 * Copyright (c) 2015, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 EXPECT_EQ(expectedURL.getString(), 198 EXPECT_EQ(expectedURL.getString(),
199 fetchRequest.resourceRequest().url().getString()); 199 fetchRequest.resourceRequest().url().getString());
200 EXPECT_EQ(expectedURL.protocol(), 200 EXPECT_EQ(expectedURL.protocol(),
201 fetchRequest.resourceRequest().url().protocol()); 201 fetchRequest.resourceRequest().url().protocol());
202 EXPECT_EQ(expectedURL.host(), fetchRequest.resourceRequest().url().host()); 202 EXPECT_EQ(expectedURL.host(), fetchRequest.resourceRequest().url().host());
203 EXPECT_EQ(expectedURL.port(), fetchRequest.resourceRequest().url().port()); 203 EXPECT_EQ(expectedURL.port(), fetchRequest.resourceRequest().url().port());
204 EXPECT_EQ(expectedURL.hasPort(), 204 EXPECT_EQ(expectedURL.hasPort(),
205 fetchRequest.resourceRequest().url().hasPort()); 205 fetchRequest.resourceRequest().url().hasPort());
206 EXPECT_EQ(expectedURL.path(), fetchRequest.resourceRequest().url().path()); 206 EXPECT_EQ(expectedURL.path(), fetchRequest.resourceRequest().url().path());
207 EXPECT_EQ(document->getInsecureRequestPolicy(),
208 fetchRequest.resourceRequest().getInsecureRequestPolicy());
207 } 209 }
208 210
209 void expectUpgradeInsecureRequestHeader(const char* input, 211 void expectUpgradeInsecureRequestHeader(const char* input,
210 WebURLRequest::FrameType frameType, 212 WebURLRequest::FrameType frameType,
211 bool shouldPrefer) { 213 bool shouldPrefer) {
212 KURL inputURL(ParsedURLString, input); 214 KURL inputURL(ParsedURLString, input);
213 215
214 FetchRequest fetchRequest = 216 FetchRequest fetchRequest =
215 FetchRequest(ResourceRequest(inputURL), FetchInitiatorInfo()); 217 FetchRequest(ResourceRequest(inputURL), FetchInitiatorInfo());
216 fetchRequest.mutableResourceRequest().setRequestContext( 218 fetchRequest.mutableResourceRequest().setRequestContext(
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource); 829 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource);
828 EXPECT_EQ(test.isExternalExpectation, mainRequest.isExternalRequest()); 830 EXPECT_EQ(test.isExternalExpectation, mainRequest.isExternalRequest());
829 831
830 ResourceRequest subRequest(test.url); 832 ResourceRequest subRequest(test.url);
831 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); 833 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource);
832 EXPECT_EQ(test.isExternalExpectation, subRequest.isExternalRequest()); 834 EXPECT_EQ(test.isExternalExpectation, subRequest.isExternalRequest());
833 } 835 }
834 } 836 }
835 837
836 } // namespace blink 838 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698