Chromium Code Reviews| Index: chrome/browser/safe_browsing/mock_report_sender.h |
| diff --git a/chrome/browser/safe_browsing/mock_report_sender.h b/chrome/browser/safe_browsing/mock_report_sender.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..625bb4d4c558648bf59b83ef1869d372dbcaee68 |
| --- /dev/null |
| +++ b/chrome/browser/safe_browsing/mock_report_sender.h |
| @@ -0,0 +1,37 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "net/url_request/report_sender.h" |
|
raymes
2016/07/26 07:42:06
nit: nothing should be above the guards
stefanocs
2016/07/26 11:17:37
Done.
|
| + |
| +#ifndef CHROME_BROWSER_SAFE_BROWSING_MOCK_REPORT_SENDER_H_ |
| +#define CHROME_BROWSER_SAFE_BROWSING_MOCK_REPORT_SENDER_H_ |
| + |
| +namespace safe_browsing { |
| + |
| +// A mock ReportSender that keeps track of the last report sent. |
| +class MockReportSender : public net::ReportSender { |
| + public: |
| + MockReportSender(); |
| + |
| + ~MockReportSender() override; |
| + |
| + void Send(const GURL& report_uri, const std::string& report) override; |
| + |
| + const GURL& latest_report_uri(); |
| + |
| + const std::string& latest_report(); |
| + |
| + int GetAndResetNumberOfReportsSent(); |
| + |
| + private: |
| + GURL latest_report_uri_; |
| + std::string latest_report_; |
| + int number_of_reports_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MockReportSender); |
| +}; |
| + |
| +} // namespace safe_browsing |
| + |
| +#endif // CHROME_BROWSER_SAFE_BROWSING_MOCK_REPORT_SENDER_H_ |