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

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

Issue 2649853003: Make Resource::setResponse() private
Patch Set: Rebase Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageDocument.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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 671
672 // Tests that when a resource with certificate errors is loaded from the memory 672 // Tests that when a resource with certificate errors is loaded from the memory
673 // cache, the embedder is notified. 673 // cache, the embedder is notified.
674 TEST_F(FrameFetchContextMockedFrameLoaderClientTest, 674 TEST_F(FrameFetchContextMockedFrameLoaderClientTest,
675 MemoryCacheCertificateError) { 675 MemoryCacheCertificateError) {
676 ResourceRequest resourceRequest(url); 676 ResourceRequest resourceRequest(url);
677 ResourceResponse response; 677 ResourceResponse response;
678 response.setURL(url); 678 response.setURL(url);
679 response.setHasMajorCertificateErrors(true); 679 response.setHasMajorCertificateErrors(true);
680 Resource* resource = MockResource::create(resourceRequest); 680 Resource* resource = MockResource::create(resourceRequest);
681 resource->setResponse(response); 681 resource->responseReceived(response, nullptr);
682 EXPECT_CALL(*client, didDisplayContentWithCertificateErrors(url)); 682 EXPECT_CALL(*client, didDisplayContentWithCertificateErrors(url));
683 fetchContext->dispatchDidLoadResourceFromMemoryCache( 683 fetchContext->dispatchDidLoadResourceFromMemoryCache(
684 createUniqueIdentifier(), resource, WebURLRequest::FrameTypeNone, 684 createUniqueIdentifier(), resource, WebURLRequest::FrameTypeNone,
685 WebURLRequest::RequestContextImage); 685 WebURLRequest::RequestContextImage);
686 } 686 }
687 687
688 TEST_F(FrameFetchContextTest, SetIsExternalRequestForPublicDocument) { 688 TEST_F(FrameFetchContextTest, SetIsExternalRequestForPublicDocument) {
689 EXPECT_EQ(WebAddressSpacePublic, document->addressSpace()); 689 EXPECT_EQ(WebAddressSpacePublic, document->addressSpace());
690 690
691 struct TestCase { 691 struct TestCase {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource); 803 fetchContext->addAdditionalRequestHeaders(mainRequest, FetchMainResource);
804 EXPECT_EQ(test.isExternalExpectation, mainRequest.isExternalRequest()); 804 EXPECT_EQ(test.isExternalExpectation, mainRequest.isExternalRequest());
805 805
806 ResourceRequest subRequest(test.url); 806 ResourceRequest subRequest(test.url);
807 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource); 807 fetchContext->addAdditionalRequestHeaders(subRequest, FetchSubresource);
808 EXPECT_EQ(test.isExternalExpectation, subRequest.isExternalRequest()); 808 EXPECT_EQ(test.isExternalExpectation, subRequest.isExternalRequest());
809 } 809 }
810 } 810 }
811 811
812 } // namespace blink 812 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/ImageDocument.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698