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

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

Issue 2719813002: Rename classes that derived from EmptyLocalFrameClient. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/loader/MixedContentChecker.h" 5 #include "core/loader/MixedContentChecker.h"
6 6
7 #include "core/frame/Settings.h" 7 #include "core/frame/Settings.h"
8 #include "core/loader/EmptyClients.h" 8 #include "core/loader/EmptyClients.h"
9 #include "core/testing/DummyPageHolder.h" 9 #include "core/testing/DummyPageHolder.h"
10 #include "platform/network/ResourceResponse.h" 10 #include "platform/network/ResourceResponse.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 "http://example.test/foo.jpg"); 96 "http://example.test/foo.jpg");
97 blockableMixedContent.setFrameType(WebURLRequest::FrameTypeAuxiliary); 97 blockableMixedContent.setFrameType(WebURLRequest::FrameTypeAuxiliary);
98 blockableMixedContent.setRequestContext(WebURLRequest::RequestContextImage); 98 blockableMixedContent.setRequestContext(WebURLRequest::RequestContextImage);
99 EXPECT_EQ(WebMixedContentContextType::OptionallyBlockable, 99 EXPECT_EQ(WebMixedContentContextType::OptionallyBlockable,
100 MixedContentChecker::contextTypeForInspector( 100 MixedContentChecker::contextTypeForInspector(
101 &dummyPageHolder->frame(), blockableMixedContent)); 101 &dummyPageHolder->frame(), blockableMixedContent));
102 } 102 }
103 103
104 namespace { 104 namespace {
105 105
106 class MockFrameLoaderClient : public EmptyLocalFrameClient { 106 class MockLocalFrameClient : public EmptyLocalFrameClient {
107 public: 107 public:
108 MockFrameLoaderClient() : EmptyLocalFrameClient() {} 108 MockLocalFrameClient() : EmptyLocalFrameClient() {}
109 MOCK_METHOD1(didDisplayContentWithCertificateErrors, void(const KURL&)); 109 MOCK_METHOD1(didDisplayContentWithCertificateErrors, void(const KURL&));
110 MOCK_METHOD1(didRunContentWithCertificateErrors, void(const KURL&)); 110 MOCK_METHOD1(didRunContentWithCertificateErrors, void(const KURL&));
111 }; 111 };
112 112
113 } // namespace 113 } // namespace
114 114
115 TEST(MixedContentCheckerTest, HandleCertificateError) { 115 TEST(MixedContentCheckerTest, HandleCertificateError) {
116 MockFrameLoaderClient* client = new MockFrameLoaderClient; 116 MockLocalFrameClient* client = new MockLocalFrameClient;
117 std::unique_ptr<DummyPageHolder> dummyPageHolder = 117 std::unique_ptr<DummyPageHolder> dummyPageHolder =
118 DummyPageHolder::create(IntSize(1, 1), nullptr, client); 118 DummyPageHolder::create(IntSize(1, 1), nullptr, client);
119 119
120 KURL mainResourceUrl(KURL(), "https://example.test"); 120 KURL mainResourceUrl(KURL(), "https://example.test");
121 KURL displayedUrl(KURL(), "https://example-displayed.test"); 121 KURL displayedUrl(KURL(), "https://example-displayed.test");
122 KURL ranUrl(KURL(), "https://example-ran.test"); 122 KURL ranUrl(KURL(), "https://example-ran.test");
123 123
124 dummyPageHolder->frame().document()->setURL(mainResourceUrl); 124 dummyPageHolder->frame().document()->setURL(mainResourceUrl);
125 ResourceResponse response1; 125 ResourceResponse response1;
126 response1.setURL(ranUrl); 126 response1.setURL(ranUrl);
(...skipping 12 matching lines...) Expand all
139 .settings() 139 .settings()
140 ->getStrictMixedContentCheckingForPlugin())); 140 ->getStrictMixedContentCheckingForPlugin()));
141 response2.setURL(displayedUrl); 141 response2.setURL(displayedUrl);
142 EXPECT_CALL(*client, didDisplayContentWithCertificateErrors(displayedUrl)); 142 EXPECT_CALL(*client, didDisplayContentWithCertificateErrors(displayedUrl));
143 MixedContentChecker::handleCertificateError( 143 MixedContentChecker::handleCertificateError(
144 &dummyPageHolder->frame(), response2, WebURLRequest::FrameTypeNone, 144 &dummyPageHolder->frame(), response2, WebURLRequest::FrameTypeNone,
145 requestContext); 145 requestContext);
146 } 146 }
147 147
148 } // namespace blink 148 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698