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" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 reporter_ = new CertificateReportingTest::MockReporter( | 133 reporter_ = new CertificateReportingTest::MockReporter( |
134 nullptr, GURL("http://example.test"), | 134 nullptr, GURL("http://example.test"), |
135 net::CertificateReportSender::DO_NOT_SEND_COOKIES); | 135 net::CertificateReportSender::DO_NOT_SEND_COOKIES); |
136 | 136 |
137 scoped_refptr<SafeBrowsingService> safe_browsing_service = | 137 scoped_refptr<SafeBrowsingService> safe_browsing_service = |
138 g_browser_process->safe_browsing_service(); | 138 g_browser_process->safe_browsing_service(); |
139 ASSERT_TRUE(safe_browsing_service); | 139 ASSERT_TRUE(safe_browsing_service); |
140 | 140 |
141 content::BrowserThread::PostTask( | 141 content::BrowserThread::PostTask( |
142 content::BrowserThread::IO, FROM_HERE, | 142 content::BrowserThread::IO, FROM_HERE, |
143 base::Bind(SetMockReporter, safe_browsing_service, | 143 base::Bind(SetMockReporter, base::RetainedRef(safe_browsing_service), |
144 base::Passed(scoped_ptr<certificate_reporting::ErrorReporter>( | 144 base::Passed(scoped_ptr<certificate_reporting::ErrorReporter>( |
145 reporter_)))); | 145 reporter_)))); |
146 } | 146 } |
147 | 147 |
148 const std::string& CertificateReportingTest::GetLatestHostnameReported() const { | 148 const std::string& CertificateReportingTest::GetLatestHostnameReported() const { |
149 return reporter_->latest_hostname_reported(); | 149 return reporter_->latest_hostname_reported(); |
150 } | 150 } |
151 | 151 |
152 void SetCertReportingOptIn(Browser* browser, OptIn opt_in) { | 152 void SetCertReportingOptIn(Browser* browser, OptIn opt_in) { |
153 browser->profile()->GetPrefs()->SetBoolean( | 153 browser->profile()->GetPrefs()->SetBoolean( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 if (!base::StringToDouble(param, &sendingThreshold)) | 185 if (!base::StringToDouble(param, &sendingThreshold)) |
186 return CERT_REPORT_NOT_EXPECTED; | 186 return CERT_REPORT_NOT_EXPECTED; |
187 | 187 |
188 if (sendingThreshold == 1.0) | 188 if (sendingThreshold == 1.0) |
189 return certificate_reporting_test_utils::CERT_REPORT_EXPECTED; | 189 return certificate_reporting_test_utils::CERT_REPORT_EXPECTED; |
190 } | 190 } |
191 return certificate_reporting_test_utils::CERT_REPORT_NOT_EXPECTED; | 191 return certificate_reporting_test_utils::CERT_REPORT_NOT_EXPECTED; |
192 } | 192 } |
193 | 193 |
194 } // namespace certificate_reporting_test_utils | 194 } // namespace certificate_reporting_test_utils |
OLD | NEW |