| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |