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..64e746002d30f6055f595f90edfe224d704a8184 |
| --- /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. |
| + |
| +#ifndef CHROME_BROWSER_SAFE_BROWSING_MOCK_REPORT_SENDER_H_ |
| +#define CHROME_BROWSER_SAFE_BROWSING_MOCK_REPORT_SENDER_H_ |
| + |
| +#include "net/url_request/report_sender.h" |
| + |
| +namespace safe_browsing { |
| + |
| +// A mock ReportSender that keeps track of the last report sent. |
|
Jialiu Lin
2016/07/26 16:28:02
could you change the class name/file name/comment
stefanocs
2016/07/27 04:11:19
Done. Renamed the class to MockPermissionReportSen
|
| +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_ |