OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/safe_browsing/mock_report_sender.h" |
| 6 |
| 7 namespace safe_browsing { |
| 8 |
| 9 MockReportSender::MockReportSender() |
| 10 : net::ReportSender(nullptr, DO_NOT_SEND_COOKIES) { |
| 11 number_of_reports_ = 0; |
| 12 } |
| 13 |
| 14 MockReportSender::~MockReportSender() {} |
| 15 |
| 16 void MockReportSender::Send(const GURL& report_uri, const std::string& report) { |
| 17 latest_report_uri_ = report_uri; |
| 18 latest_report_ = report; |
| 19 number_of_reports_++; |
| 20 } |
| 21 |
| 22 const GURL& MockReportSender::latest_report_uri() { |
| 23 return latest_report_uri_; |
| 24 } |
| 25 |
| 26 const std::string& MockReportSender::latest_report() { |
| 27 return latest_report_; |
| 28 } |
| 29 |
| 30 int MockReportSender::GetAndResetNumberOfReportsSent() { |
| 31 int new_reports = number_of_reports_; |
| 32 number_of_reports_ = 0; |
| 33 return new_reports; |
| 34 } |
| 35 |
| 36 } // namespace safe_browsing |
OLD | NEW |