OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/ssl/certificate_reporting_test_utils.h" | 5 #include "chrome/browser/ssl/certificate_reporting_test_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/safe_browsing/ping_manager.h" | 15 #include "chrome/browser/safe_browsing/ping_manager.h" |
16 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 16 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
17 #include "chrome/browser/safe_browsing/ui_manager.h" | 17 #include "chrome/browser/safe_browsing/ui_manager.h" |
18 #include "chrome/browser/ssl/cert_report_helper.h" | 18 #include "chrome/browser/ssl/cert_report_helper.h" |
19 #include "chrome/browser/ssl/ssl_cert_reporter.h" | 19 #include "chrome/browser/ssl/ssl_cert_reporter.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
22 #include "components/certificate_reporting/error_report.h" | 22 #include "components/certificate_reporting/error_report.h" |
23 #include "components/certificate_reporting/error_reporter.h" | 23 #include "components/certificate_reporting/error_reporter.h" |
24 #include "components/variations/variations_associated_data.h" | 24 #include "components/variations/variations_associated_data.h" |
25 #include "net/url_request/certificate_report_sender.h" | 25 #include "net/url_request/certificate_report_sender.h" |
26 #include "net/url_request/url_request_context.h" | 26 #include "net/url_request/url_request_context.h" |
27 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
28 #include "url/gurl.h" | 28 #include "url/gurl.h" |
29 | 29 |
| 30 using safe_browsing::SafeBrowsingService; |
| 31 using safe_browsing::SafeBrowsingUIManager; |
| 32 |
30 namespace { | 33 namespace { |
31 | 34 |
32 void SetMockReporter( | 35 void SetMockReporter( |
33 SafeBrowsingService* safe_browsing_service, | 36 SafeBrowsingService* safe_browsing_service, |
34 scoped_ptr<certificate_reporting::ErrorReporter> reporter) { | 37 scoped_ptr<certificate_reporting::ErrorReporter> reporter) { |
35 safe_browsing_service->ping_manager()->SetCertificateErrorReporterForTesting( | 38 safe_browsing_service->ping_manager()->SetCertificateErrorReporterForTesting( |
36 reporter.Pass()); | 39 reporter.Pass()); |
37 } | 40 } |
38 | 41 |
39 // This is a test implementation of the interface that blocking pages | 42 // This is a test implementation of the interface that blocking pages |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 if (!base::StringToDouble(param, &sendingThreshold)) | 182 if (!base::StringToDouble(param, &sendingThreshold)) |
180 return CERT_REPORT_NOT_EXPECTED; | 183 return CERT_REPORT_NOT_EXPECTED; |
181 | 184 |
182 if (sendingThreshold == 1.0) | 185 if (sendingThreshold == 1.0) |
183 return certificate_reporting_test_utils::CERT_REPORT_EXPECTED; | 186 return certificate_reporting_test_utils::CERT_REPORT_EXPECTED; |
184 } | 187 } |
185 return certificate_reporting_test_utils::CERT_REPORT_NOT_EXPECTED; | 188 return certificate_reporting_test_utils::CERT_REPORT_NOT_EXPECTED; |
186 } | 189 } |
187 | 190 |
188 } // namespace certificate_reporting_test_utils | 191 } // namespace certificate_reporting_test_utils |
OLD | NEW |