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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc

Issue 2784253004: Componentize safe_browsing: decouple threat_details* from the chrome/ layer. (Closed)
Patch Set: address comment Created 3 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This test creates a fake safebrowsing service, where we can inject known- 5 // This test creates a fake safebrowsing service, where we can inject known-
6 // threat urls. It then uses a real browser to go to these urls, and sends 6 // threat urls. It then uses a real browser to go to these urls, and sends
7 // "goback" or "proceed" commands and verifies they work. 7 // "goback" or "proceed" commands and verifies they work.
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 } // namespace 209 } // namespace
210 210
211 class TestThreatDetailsFactory : public ThreatDetailsFactory { 211 class TestThreatDetailsFactory : public ThreatDetailsFactory {
212 public: 212 public:
213 TestThreatDetailsFactory() : details_() {} 213 TestThreatDetailsFactory() : details_() {}
214 ~TestThreatDetailsFactory() override {} 214 ~TestThreatDetailsFactory() override {}
215 215
216 ThreatDetails* CreateThreatDetails( 216 ThreatDetails* CreateThreatDetails(
217 BaseUIManager* delegate, 217 BaseUIManager* delegate,
218 WebContents* web_contents, 218 WebContents* web_contents,
219 const security_interstitials::UnsafeResource& unsafe_resource) override { 219 const security_interstitials::UnsafeResource& unsafe_resource,
220 details_ = new ThreatDetails(delegate, web_contents, unsafe_resource); 220 net::URLRequestContextGetter* request_context_getter,
221 history::HistoryService* history_service) override {
222 details_ = new ThreatDetails(delegate, web_contents, unsafe_resource,
223 request_context_getter, history_service);
221 return details_; 224 return details_;
222 } 225 }
223 226
224 ThreatDetails* get_details() { return details_; } 227 ThreatDetails* get_details() { return details_; }
225 228
226 private: 229 private:
227 ThreatDetails* details_; 230 ThreatDetails* details_;
228 }; 231 };
229 232
230 // A SafeBrowingBlockingPage class that lets us wait until it's hidden. 233 // A SafeBrowingBlockingPage class that lets us wait until it's hidden.
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1434 1437
1435 INSTANTIATE_TEST_CASE_P( 1438 INSTANTIATE_TEST_CASE_P(
1436 SafeBrowsingBlockingPageIDNTestWithThreatType, 1439 SafeBrowsingBlockingPageIDNTestWithThreatType,
1437 SafeBrowsingBlockingPageIDNTest, 1440 SafeBrowsingBlockingPageIDNTest,
1438 testing::Combine(testing::Values(false, true), 1441 testing::Combine(testing::Values(false, true),
1439 testing::Values(SB_THREAT_TYPE_URL_MALWARE, 1442 testing::Values(SB_THREAT_TYPE_URL_MALWARE,
1440 SB_THREAT_TYPE_URL_PHISHING, 1443 SB_THREAT_TYPE_URL_PHISHING,
1441 SB_THREAT_TYPE_URL_UNWANTED))); 1444 SB_THREAT_TYPE_URL_UNWANTED)));
1442 1445
1443 } // namespace safe_browsing 1446 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page.cc ('k') | chrome/browser/safe_browsing/threat_details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698