OLD | NEW |
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 { | 97 { |
98 KURL inputURL(ParsedURLString, input); | 98 KURL inputURL(ParsedURLString, input); |
99 | 99 |
100 FetchRequest fetchRequest = FetchRequest(ResourceRequest(inputURL), Fetc
hInitiatorInfo()); | 100 FetchRequest fetchRequest = FetchRequest(ResourceRequest(inputURL), Fetc
hInitiatorInfo()); |
101 fetchRequest.mutableResourceRequest().setRequestContext(WebURLRequest::R
equestContextScript); | 101 fetchRequest.mutableResourceRequest().setRequestContext(WebURLRequest::R
equestContextScript); |
102 fetchRequest.mutableResourceRequest().setFrameType(frameType); | 102 fetchRequest.mutableResourceRequest().setFrameType(frameType); |
103 | 103 |
104 fetchContext->upgradeInsecureRequest(fetchRequest); | 104 fetchContext->upgradeInsecureRequest(fetchRequest); |
105 | 105 |
106 EXPECT_STREQ(shouldPrefer ? "1" : "", | 106 EXPECT_STREQ(shouldPrefer ? "1" : "", |
107 fetchRequest.resourceRequest().httpHeaderField("HTTPS").utf8().data(
)); | 107 fetchRequest.resourceRequest().httpHeaderField("Upgrade-Insecure-Req
uests").utf8().data()); |
108 } | 108 } |
109 | 109 |
110 KURL secureURL; | 110 KURL secureURL; |
111 RefPtr<SecurityOrigin> exampleOrigin; | 111 RefPtr<SecurityOrigin> exampleOrigin; |
112 RefPtr<SecurityOrigin> secureOrigin; | 112 RefPtr<SecurityOrigin> secureOrigin; |
113 | 113 |
114 OwnPtr<DummyPageHolder> dummyPageHolder; | 114 OwnPtr<DummyPageHolder> dummyPageHolder; |
115 // We don't use the DocumentLoader directly in any tests, but need to keep i
t around as long | 115 // We don't use the DocumentLoader directly in any tests, but need to keep i
t around as long |
116 // as the ResourceFetcher and Document live due to indirect usage. | 116 // as the ResourceFetcher and Document live due to indirect usage. |
117 RefPtrWillBePersistent<DocumentLoader> documentLoader; | 117 RefPtrWillBePersistent<DocumentLoader> documentLoader; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 preferences.setShouldSendDPR(true); | 314 preferences.setShouldSendDPR(true); |
315 preferences.setShouldSendResourceWidth(true); | 315 preferences.setShouldSendResourceWidth(true); |
316 preferences.setShouldSendViewportWidth(true); | 316 preferences.setShouldSendViewportWidth(true); |
317 document->setClientHintsPreferences(preferences); | 317 document->setClientHintsPreferences(preferences); |
318 expectHeader("http://www.example.com/1.gif", "DPR", true, "1"); | 318 expectHeader("http://www.example.com/1.gif", "DPR", true, "1"); |
319 expectHeader("http://www.example.com/1.gif", "Width", true, "400", 400); | 319 expectHeader("http://www.example.com/1.gif", "Width", true, "400", 400); |
320 expectHeader("http://www.example.com/1.gif", "Viewport-Width", true, "500"); | 320 expectHeader("http://www.example.com/1.gif", "Viewport-Width", true, "500"); |
321 } | 321 } |
322 | 322 |
323 } // namespace | 323 } // namespace |
OLD | NEW |