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 |
| 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
13 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
15 #include "chrome/browser/history/history_service_factory.h" | 16 #include "chrome/browser/history/history_service_factory.h" |
16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/safe_browsing/browser_features.h" | 18 #include "chrome/browser/safe_browsing/browser_features.h" |
18 #include "chrome/browser/safe_browsing/client_side_detection_host.h" | 19 #include "chrome/browser/safe_browsing/client_side_detection_host.h" |
19 #include "chrome/browser/safe_browsing/database_manager.h" | 20 #include "chrome/browser/safe_browsing/database_manager.h" |
20 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 21 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 // First ip is good but all the others are bad. | 652 // First ip is good but all the others are bad. |
652 EXPECT_CALL(*db_manager_, MatchMalwareIP(ip)).WillOnce(Return(i > 0)); | 653 EXPECT_CALL(*db_manager_, MatchMalwareIP(ip)).WillOnce(Return(i > 0)); |
653 } | 654 } |
654 | 655 |
655 ExtractMalwareFeatures(&request); | 656 ExtractMalwareFeatures(&request); |
656 // The number of IP matched url we store is capped at 5 IPs per request. | 657 // The number of IP matched url we store is capped at 5 IPs per request. |
657 EXPECT_EQ(5, request.bad_ip_url_info_size()); | 658 EXPECT_EQ(5, request.bad_ip_url_info_size()); |
658 } | 659 } |
659 | 660 |
660 } // namespace safe_browsing | 661 } // namespace safe_browsing |
OLD | NEW |