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 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" | 5 #include "chrome/browser/safe_browsing/browser_feature_extractor.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 void TearDown() override { | 96 void TearDown() override { |
97 extractor_.reset(); | 97 extractor_.reset(); |
98 host_.reset(); | 98 host_.reset(); |
99 db_manager_ = NULL; | 99 db_manager_ = NULL; |
100 profile()->DestroyHistoryService(); | 100 profile()->DestroyHistoryService(); |
101 ChromeRenderViewHostTestHarness::TearDown(); | 101 ChromeRenderViewHostTestHarness::TearDown(); |
102 ASSERT_EQ(0, num_pending_); | 102 ASSERT_EQ(0, num_pending_); |
103 } | 103 } |
104 | 104 |
105 HistoryService* history_service() { | 105 HistoryService* history_service() { |
106 return HistoryServiceFactory::GetForProfile(profile(), | 106 return HistoryServiceFactory::GetForProfile( |
107 Profile::EXPLICIT_ACCESS); | 107 profile(), ServiceAccessType::EXPLICIT_ACCESS); |
108 } | 108 } |
109 | 109 |
110 void SetRedirectChain(const std::vector<GURL>& redirect_chain, | 110 void SetRedirectChain(const std::vector<GURL>& redirect_chain, |
111 bool new_host) { | 111 bool new_host) { |
112 browse_info_->url_redirects = redirect_chain; | 112 browse_info_->url_redirects = redirect_chain; |
113 if (new_host) { | 113 if (new_host) { |
114 browse_info_->host_redirects = redirect_chain; | 114 browse_info_->host_redirects = redirect_chain; |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 // First ip is good but all the others are bad. | 650 // First ip is good but all the others are bad. |
651 EXPECT_CALL(*db_manager_, MatchMalwareIP(ip)).WillOnce(Return(i > 0)); | 651 EXPECT_CALL(*db_manager_, MatchMalwareIP(ip)).WillOnce(Return(i > 0)); |
652 } | 652 } |
653 | 653 |
654 ExtractMalwareFeatures(&request); | 654 ExtractMalwareFeatures(&request); |
655 // The number of IP matched url we store is capped at 5 IPs per request. | 655 // The number of IP matched url we store is capped at 5 IPs per request. |
656 EXPECT_EQ(5, request.bad_ip_url_info_size()); | 656 EXPECT_EQ(5, request.bad_ip_url_info_size()); |
657 } | 657 } |
658 | 658 |
659 } // namespace safe_browsing | 659 } // namespace safe_browsing |
OLD | NEW |