| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |