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/download_protection_service.h" | 5 #include "chrome/browser/safe_browsing/download_protection_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/base_paths.h" | 12 #include "base/base_paths.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
18 #include "base/files/scoped_temp_dir.h" | 18 #include "base/files/scoped_temp_dir.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
22 #include "base/message_loop/message_loop.h" | 22 #include "base/message_loop/message_loop.h" |
23 #include "base/path_service.h" | 23 #include "base/path_service.h" |
24 #include "base/prefs/pref_service.h" | |
25 #include "base/run_loop.h" | 24 #include "base/run_loop.h" |
26 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
27 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
28 #include "chrome/browser/history/history_service_factory.h" | 27 #include "chrome/browser/history/history_service_factory.h" |
29 #include "chrome/browser/safe_browsing/download_feedback_service.h" | 28 #include "chrome/browser/safe_browsing/download_feedback_service.h" |
30 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" | 29 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" |
31 #include "chrome/browser/safe_browsing/local_database_manager.h" | 30 #include "chrome/browser/safe_browsing/local_database_manager.h" |
32 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 31 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
33 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
34 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
35 #include "chrome/common/safe_browsing/binary_feature_extractor.h" | 34 #include "chrome/common/safe_browsing/binary_feature_extractor.h" |
36 #include "chrome/common/safe_browsing/csd.pb.h" | 35 #include "chrome/common/safe_browsing/csd.pb.h" |
37 #include "chrome/test/base/testing_profile.h" | 36 #include "chrome/test/base/testing_profile.h" |
38 #include "components/history/core/browser/history_service.h" | 37 #include "components/history/core/browser/history_service.h" |
| 38 #include "components/prefs/pref_service.h" |
39 #include "components/safe_browsing_db/database_manager.h" | 39 #include "components/safe_browsing_db/database_manager.h" |
40 #include "components/safe_browsing_db/test_database_manager.h" | 40 #include "components/safe_browsing_db/test_database_manager.h" |
41 #include "content/public/browser/download_danger_type.h" | 41 #include "content/public/browser/download_danger_type.h" |
42 #include "content/public/browser/page_navigator.h" | 42 #include "content/public/browser/page_navigator.h" |
43 #include "content/public/test/mock_download_item.h" | 43 #include "content/public/test/mock_download_item.h" |
44 #include "content/public/test/test_browser_thread_bundle.h" | 44 #include "content/public/test/test_browser_thread_bundle.h" |
45 #include "content/public/test/test_utils.h" | 45 #include "content/public/test/test_utils.h" |
46 #include "net/base/url_util.h" | 46 #include "net/base/url_util.h" |
47 #include "net/cert/x509_certificate.h" | 47 #include "net/cert/x509_certificate.h" |
48 #include "net/http/http_status_code.h" | 48 #include "net/http/http_status_code.h" |
(...skipping 1952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2001 &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, | 2001 &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, |
2002 base::Unretained(this))); | 2002 base::Unretained(this))); |
2003 MessageLoop::current()->Run(); | 2003 MessageLoop::current()->Run(); |
2004 | 2004 |
2005 EXPECT_FALSE(HasClientDownloadRequest()); | 2005 EXPECT_FALSE(HasClientDownloadRequest()); |
2006 // Overriden by flag: | 2006 // Overriden by flag: |
2007 EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS)); | 2007 EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS)); |
2008 } | 2008 } |
2009 | 2009 |
2010 } // namespace safe_browsing | 2010 } // namespace safe_browsing |
OLD | NEW |