| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/loader/FrameFetchContext.h" | 31 #include "core/loader/FrameFetchContext.h" |
| 32 | 32 |
| 33 #include "core/fetch/FetchInitiatorInfo.h" | 33 #include "core/fetch/FetchInitiatorInfo.h" |
| 34 #include "core/fetch/UniqueIdentifier.h" |
| 34 #include "core/frame/FrameHost.h" | 35 #include "core/frame/FrameHost.h" |
| 35 #include "core/frame/FrameOwner.h" | 36 #include "core/frame/FrameOwner.h" |
| 36 #include "core/frame/FrameView.h" | 37 #include "core/frame/FrameView.h" |
| 37 #include "core/frame/Settings.h" | 38 #include "core/frame/Settings.h" |
| 38 #include "core/html/HTMLDocument.h" | 39 #include "core/html/HTMLDocument.h" |
| 39 #include "core/loader/DocumentLoader.h" | 40 #include "core/loader/DocumentLoader.h" |
| 40 #include "core/loader/EmptyClients.h" | 41 #include "core/loader/EmptyClients.h" |
| 41 #include "core/page/Page.h" | 42 #include "core/page/Page.h" |
| 42 #include "core/testing/DummyPageHolder.h" | 43 #include "core/testing/DummyPageHolder.h" |
| 43 #include "platform/network/ResourceRequest.h" | 44 #include "platform/network/ResourceRequest.h" |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 // memory cache, the embedder is notified. | 565 // memory cache, the embedder is notified. |
| 565 TEST_F(FrameFetchContextDisplayedCertificateErrorsTest, MemoryCacheCertificateEr
ror) | 566 TEST_F(FrameFetchContextDisplayedCertificateErrorsTest, MemoryCacheCertificateEr
ror) |
| 566 { | 567 { |
| 567 ResourceRequest resourceRequest(url); | 568 ResourceRequest resourceRequest(url); |
| 568 ResourceResponse response; | 569 ResourceResponse response; |
| 569 response.setURL(url); | 570 response.setURL(url); |
| 570 response.setSecurityInfo(securityInfo); | 571 response.setSecurityInfo(securityInfo); |
| 571 response.setHasMajorCertificateErrors(true); | 572 response.setHasMajorCertificateErrors(true); |
| 572 Resource* resource = Resource::create(resourceRequest, Resource::Image); | 573 Resource* resource = Resource::create(resourceRequest, Resource::Image); |
| 573 resource->setResponse(response); | 574 resource->setResponse(response); |
| 574 fetchContext->dispatchDidLoadResourceFromMemoryCache(resource, WebURLRequest
::FrameTypeNone, WebURLRequest::RequestContextImage); | 575 fetchContext->dispatchDidLoadResourceFromMemoryCache(createUniqueIdentifier(
), resource, WebURLRequest::FrameTypeNone, WebURLRequest::RequestContextImage); |
| 575 } | 576 } |
| 576 | 577 |
| 577 TEST_F(FrameFetchContextTest, SetIsExternalRequestForPublicDocument) | 578 TEST_F(FrameFetchContextTest, SetIsExternalRequestForPublicDocument) |
| 578 { | 579 { |
| 579 EXPECT_EQ(WebAddressSpacePublic, document->addressSpace()); | 580 EXPECT_EQ(WebAddressSpacePublic, document->addressSpace()); |
| 580 | 581 |
| 581 struct TestCase { | 582 struct TestCase { |
| 582 const char* url; | 583 const char* url; |
| 583 bool isExternalExpectation; | 584 bool isExternalExpectation; |
| 584 } cases[] = { | 585 } cases[] = { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource
); | 711 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource
); |
| 711 EXPECT_EQ(mainRequest.isExternalRequest(), test.isExternalExpectation); | 712 EXPECT_EQ(mainRequest.isExternalRequest(), test.isExternalExpectation); |
| 712 | 713 |
| 713 ResourceRequest subRequest(test.url); | 714 ResourceRequest subRequest(test.url); |
| 714 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); | 715 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); |
| 715 EXPECT_EQ(subRequest.isExternalRequest(), test.isExternalExpectation); | 716 EXPECT_EQ(subRequest.isExternalRequest(), test.isExternalExpectation); |
| 716 } | 717 } |
| 717 } | 718 } |
| 718 | 719 |
| 719 } // namespace blink | 720 } // namespace blink |
| OLD | NEW |