| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/certificate_reporting_service_test_utils.
h" | 5 #include "chrome/browser/safe_browsing/certificate_reporting_service_test_utils.
h" |
| 6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "components/certificate_reporting/encrypted_cert_logger.pb.h" | 8 #include "components/certificate_reporting/encrypted_cert_logger.pb.h" |
| 9 #include "components/certificate_reporting/error_report.h" | 9 #include "components/certificate_reporting/error_report.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 Resume(); | 180 Resume(); |
| 181 } | 181 } |
| 182 | 182 |
| 183 int DelayableCertReportURLRequestJob::ReadRawData(net::IOBuffer* buf, | 183 int DelayableCertReportURLRequestJob::ReadRawData(net::IOBuffer* buf, |
| 184 int buf_size) { | 184 int buf_size) { |
| 185 // Report sender ignores responses. Return empty response. | 185 // Report sender ignores responses. Return empty response. |
| 186 return 0; | 186 return 0; |
| 187 } | 187 } |
| 188 | 188 |
| 189 int DelayableCertReportURLRequestJob::GetResponseCode() const { | |
| 190 // Report sender ignores responses. Return empty response. | |
| 191 return 200; | |
| 192 } | |
| 193 | |
| 194 void DelayableCertReportURLRequestJob::GetResponseInfo( | 189 void DelayableCertReportURLRequestJob::GetResponseInfo( |
| 195 net::HttpResponseInfo* info) { | 190 net::HttpResponseInfo* info) { |
| 196 // Report sender ignores responses. Return empty response. | 191 // Report sender ignores responses. Return empty response. |
| 197 } | 192 } |
| 198 | 193 |
| 199 void DelayableCertReportURLRequestJob::Resume() { | 194 void DelayableCertReportURLRequestJob::Resume() { |
| 200 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 195 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 201 if (!started_) { | 196 if (!started_) { |
| 202 // If Start() hasn't been called yet, then unset |delayed_| so that when | 197 // If Start() hasn't been called yet, then unset |delayed_| so that when |
| 203 // Start() is called, the request will begin immediately. | 198 // Start() is called, the request will begin immediately. |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 433 |
| 439 if (service->GetReporterForTesting()) { | 434 if (service->GetReporterForTesting()) { |
| 440 // Reporter can be null if reporting is disabled. | 435 // Reporter can be null if reporting is disabled. |
| 441 EXPECT_EQ( | 436 EXPECT_EQ( |
| 442 0u, | 437 0u, |
| 443 service->GetReporterForTesting()->inflight_report_count_for_testing()); | 438 service->GetReporterForTesting()->inflight_report_count_for_testing()); |
| 444 } | 439 } |
| 445 } | 440 } |
| 446 | 441 |
| 447 } // namespace certificate_reporting_test_utils | 442 } // namespace certificate_reporting_test_utils |
| OLD | NEW |