| 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 } | 606 } |
| 607 | 607 |
| 608 // Tests that when a resource with certificate errors is loaded from the memory | 608 // Tests that when a resource with certificate errors is loaded from the memory |
| 609 // cache, the embedder is notified. | 609 // cache, the embedder is notified. |
| 610 TEST_F(FrameFetchContextDisplayedCertificateErrorsTest, | 610 TEST_F(FrameFetchContextDisplayedCertificateErrorsTest, |
| 611 MemoryCacheCertificateError) { | 611 MemoryCacheCertificateError) { |
| 612 ResourceRequest resourceRequest(url); | 612 ResourceRequest resourceRequest(url); |
| 613 ResourceResponse response; | 613 ResourceResponse response; |
| 614 response.setURL(url); | 614 response.setURL(url); |
| 615 response.setHasMajorCertificateErrors(true); | 615 response.setHasMajorCertificateErrors(true); |
| 616 Resource* resource = Resource::create(resourceRequest, Resource::Image); | 616 Resource* resource = ImageResource::create(resourceRequest); |
| 617 resource->setResponse(response); | 617 resource->setResponse(response); |
| 618 fetchContext->dispatchDidLoadResourceFromMemoryCache( | 618 fetchContext->dispatchDidLoadResourceFromMemoryCache( |
| 619 createUniqueIdentifier(), resource, WebURLRequest::FrameTypeNone, | 619 createUniqueIdentifier(), resource, WebURLRequest::FrameTypeNone, |
| 620 WebURLRequest::RequestContextImage); | 620 WebURLRequest::RequestContextImage); |
| 621 } | 621 } |
| 622 | 622 |
| 623 TEST_F(FrameFetchContextTest, SetIsExternalRequestForPublicDocument) { | 623 TEST_F(FrameFetchContextTest, SetIsExternalRequestForPublicDocument) { |
| 624 EXPECT_EQ(WebAddressSpacePublic, document->addressSpace()); | 624 EXPECT_EQ(WebAddressSpacePublic, document->addressSpace()); |
| 625 | 625 |
| 626 struct TestCase { | 626 struct TestCase { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource); | 738 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource); |
| 739 EXPECT_EQ(test.isExternalExpectation, mainRequest.isExternalRequest()); | 739 EXPECT_EQ(test.isExternalExpectation, mainRequest.isExternalRequest()); |
| 740 | 740 |
| 741 ResourceRequest subRequest(test.url); | 741 ResourceRequest subRequest(test.url); |
| 742 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); | 742 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); |
| 743 EXPECT_EQ(test.isExternalExpectation, subRequest.isExternalRequest()); | 743 EXPECT_EQ(test.isExternalExpectation, subRequest.isExternalRequest()); |
| 744 } | 744 } |
| 745 } | 745 } |
| 746 | 746 |
| 747 } // namespace blink | 747 } // namespace blink |
| OLD | NEW |