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

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

Issue 1287453005: Merge 198924 "UPGRADE: Rename the 'https' header." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2403_901/
Patch Set: Created 5 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/FrameFetchContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 { 91 {
92 KURL inputURL(ParsedURLString, input); 92 KURL inputURL(ParsedURLString, input);
93 93
94 FetchRequest fetchRequest = FetchRequest(ResourceRequest(inputURL), Fetc hInitiatorInfo()); 94 FetchRequest fetchRequest = FetchRequest(ResourceRequest(inputURL), Fetc hInitiatorInfo());
95 fetchRequest.mutableResourceRequest().setRequestContext(WebURLRequest::R equestContextScript); 95 fetchRequest.mutableResourceRequest().setRequestContext(WebURLRequest::R equestContextScript);
96 fetchRequest.mutableResourceRequest().setFrameType(frameType); 96 fetchRequest.mutableResourceRequest().setFrameType(frameType);
97 97
98 fetchContext->upgradeInsecureRequest(fetchRequest); 98 fetchContext->upgradeInsecureRequest(fetchRequest);
99 99
100 EXPECT_STREQ(shouldPrefer ? "1" : "", 100 EXPECT_STREQ(shouldPrefer ? "1" : "",
101 fetchRequest.resourceRequest().httpHeaderField("HTTPS").utf8().data( )); 101 fetchRequest.resourceRequest().httpHeaderField("Upgrade-Insecure-Req uests").utf8().data());
102 } 102 }
103 103
104 KURL secureURL; 104 KURL secureURL;
105 RefPtr<SecurityOrigin> exampleOrigin; 105 RefPtr<SecurityOrigin> exampleOrigin;
106 RefPtr<SecurityOrigin> secureOrigin; 106 RefPtr<SecurityOrigin> secureOrigin;
107 107
108 OwnPtr<DummyPageHolder> dummyPageHolder; 108 OwnPtr<DummyPageHolder> dummyPageHolder;
109 // We don't use the DocumentLoader directly in any tests, but need to keep i t around as long 109 // We don't use the DocumentLoader directly in any tests, but need to keep i t around as long
110 // as the ResourceFetcher and Document live due to indirect usage. 110 // as the ResourceFetcher and Document live due to indirect usage.
111 RefPtr<DocumentLoader> documentLoader; 111 RefPtr<DocumentLoader> documentLoader;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 ClientHintsPreferences preferences; 281 ClientHintsPreferences preferences;
282 preferences.setShouldSendDPR(true); 282 preferences.setShouldSendDPR(true);
283 preferences.setShouldSendRW(true); 283 preferences.setShouldSendRW(true);
284 document->setClientHintsPreferences(preferences); 284 document->setClientHintsPreferences(preferences);
285 expectHeader("http://www.example.com/1.gif", "DPR", true, "1"); 285 expectHeader("http://www.example.com/1.gif", "DPR", true, "1");
286 expectHeader("http://www.example.com/1.gif", "RW", true, "500"); 286 expectHeader("http://www.example.com/1.gif", "RW", true, "500");
287 } 287 }
288 288
289 } // namespace 289 } // namespace
290 290
OLDNEW
« 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