| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/metrics/field_trial.h" | 12 #include "base/metrics/field_trial.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ssl/cert_report_helper.h" | 16 #include "chrome/browser/ssl/cert_report_helper.h" |
| 17 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "components/certificate_reporting/error_report.h" | 18 #include "components/certificate_reporting/error_report.h" |
| 19 #include "components/prefs/pref_service.h" | 19 #include "components/prefs/pref_service.h" |
| 20 #include "components/safe_browsing_db/safe_browsing_prefs.h" | 20 #include "components/safe_browsing/common/safe_browsing_prefs.h" |
| 21 #include "components/variations/variations_associated_data.h" | 21 #include "components/variations/variations_associated_data.h" |
| 22 #include "net/url_request/report_sender.h" | 22 #include "net/url_request/report_sender.h" |
| 23 #include "net/url_request/url_request_context.h" | 23 #include "net/url_request/url_request_context.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 25 | 25 |
| 26 namespace certificate_reporting_test_utils { | 26 namespace certificate_reporting_test_utils { |
| 27 | 27 |
| 28 // This is a test implementation of the interface that blocking pages use to | 28 // This is a test implementation of the interface that blocking pages use to |
| 29 // send certificate reports. It checks that the blocking page calls or does not | 29 // send certificate reports. It checks that the blocking page calls or does not |
| 30 // call the report method when a report should or should not be sent, | 30 // call the report method when a report should or should not be sent, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (!base::StringToDouble(param, &sendingThreshold)) | 101 if (!base::StringToDouble(param, &sendingThreshold)) |
| 102 return CERT_REPORT_NOT_EXPECTED; | 102 return CERT_REPORT_NOT_EXPECTED; |
| 103 | 103 |
| 104 if (sendingThreshold == 1.0) | 104 if (sendingThreshold == 1.0) |
| 105 return certificate_reporting_test_utils::CERT_REPORT_EXPECTED; | 105 return certificate_reporting_test_utils::CERT_REPORT_EXPECTED; |
| 106 } | 106 } |
| 107 return certificate_reporting_test_utils::CERT_REPORT_NOT_EXPECTED; | 107 return certificate_reporting_test_utils::CERT_REPORT_NOT_EXPECTED; |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace certificate_reporting_test_utils | 110 } // namespace certificate_reporting_test_utils |
| OLD | NEW |