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 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/history/history_service_factory.h" | 31 #include "chrome/browser/history/history_service_factory.h" |
32 #include "chrome/browser/safe_browsing/download_feedback_service.h" | 32 #include "chrome/browser/safe_browsing/download_feedback_service.h" |
33 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" | 33 #include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_ser
vice.h" |
34 #include "chrome/browser/safe_browsing/local_database_manager.h" | 34 #include "chrome/browser/safe_browsing/local_database_manager.h" |
35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 35 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
36 #include "chrome/common/safe_browsing/binary_feature_extractor.h" | 36 #include "chrome/common/safe_browsing/binary_feature_extractor.h" |
37 #include "chrome/common/safe_browsing/file_type_policies_test_util.h" | 37 #include "chrome/common/safe_browsing/file_type_policies_test_util.h" |
38 #include "chrome/test/base/testing_profile.h" | 38 #include "chrome/test/base/testing_profile.h" |
39 #include "components/history/core/browser/history_service.h" | 39 #include "components/history/core/browser/history_service.h" |
40 #include "components/prefs/pref_service.h" | 40 #include "components/prefs/pref_service.h" |
| 41 #include "components/safe_browsing/common/safe_browsing_prefs.h" |
41 #include "components/safe_browsing/common/safebrowsing_switches.h" | 42 #include "components/safe_browsing/common/safebrowsing_switches.h" |
42 #include "components/safe_browsing/csd.pb.h" | 43 #include "components/safe_browsing/csd.pb.h" |
43 #include "components/safe_browsing_db/database_manager.h" | 44 #include "components/safe_browsing_db/database_manager.h" |
44 #include "components/safe_browsing_db/safe_browsing_prefs.h" | |
45 #include "components/safe_browsing_db/test_database_manager.h" | 45 #include "components/safe_browsing_db/test_database_manager.h" |
46 #include "content/public/browser/download_danger_type.h" | 46 #include "content/public/browser/download_danger_type.h" |
47 #include "content/public/browser/page_navigator.h" | 47 #include "content/public/browser/page_navigator.h" |
48 #include "content/public/test/mock_download_item.h" | 48 #include "content/public/test/mock_download_item.h" |
49 #include "content/public/test/test_browser_thread_bundle.h" | 49 #include "content/public/test/test_browser_thread_bundle.h" |
50 #include "content/public/test/test_utils.h" | 50 #include "content/public/test/test_utils.h" |
51 #include "net/base/url_util.h" | 51 #include "net/base/url_util.h" |
52 #include "net/cert/x509_certificate.h" | 52 #include "net/cert/x509_certificate.h" |
53 #include "net/http/http_status_code.h" | 53 #include "net/http/http_status_code.h" |
54 #include "net/url_request/test_url_fetcher_factory.h" | 54 #include "net/url_request/test_url_fetcher_factory.h" |
(...skipping 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2345 &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, | 2345 &item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback, |
2346 base::Unretained(this), run_loop.QuitClosure())); | 2346 base::Unretained(this), run_loop.QuitClosure())); |
2347 run_loop.Run(); | 2347 run_loop.Run(); |
2348 | 2348 |
2349 EXPECT_FALSE(HasClientDownloadRequest()); | 2349 EXPECT_FALSE(HasClientDownloadRequest()); |
2350 // Overriden by flag: | 2350 // Overriden by flag: |
2351 EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS)); | 2351 EXPECT_TRUE(IsResult(DownloadProtectionService::DANGEROUS)); |
2352 } | 2352 } |
2353 | 2353 |
2354 } // namespace safe_browsing | 2354 } // namespace safe_browsing |
OLD | NEW |