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 #ifndef CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ |
7 | 7 |
| 8 #include "base/threading/thread_checker.h" |
8 #include "net/url_request/report_sender.h" | 9 #include "net/url_request/report_sender.h" |
9 | 10 |
10 namespace safe_browsing { | 11 namespace safe_browsing { |
11 | 12 |
12 // A mock ReportSender that keeps track of the last report sent and the number | 13 // A mock ReportSender that keeps track of the last report sent and the number |
13 // of reports sent. | 14 // of reports sent. |
14 class MockPermissionReportSender : public net::ReportSender { | 15 class MockPermissionReportSender : public net::ReportSender { |
15 public: | 16 public: |
16 MockPermissionReportSender(); | 17 MockPermissionReportSender(); |
17 | 18 |
18 ~MockPermissionReportSender() override; | 19 ~MockPermissionReportSender() override; |
19 | 20 |
20 void Send(const GURL& report_uri, const std::string& report) override; | 21 void Send(const GURL& report_uri, const std::string& report) override; |
21 | 22 |
22 const GURL& latest_report_uri(); | 23 const GURL& latest_report_uri(); |
23 | 24 |
24 const std::string& latest_report(); | 25 const std::string& latest_report(); |
25 | 26 |
26 int GetAndResetNumberOfReportsSent(); | 27 int GetAndResetNumberOfReportsSent(); |
27 | 28 |
28 private: | 29 private: |
29 GURL latest_report_uri_; | 30 GURL latest_report_uri_; |
30 std::string latest_report_; | 31 std::string latest_report_; |
31 int number_of_reports_; | 32 int number_of_reports_; |
| 33 base::ThreadChecker thread_checker_; |
| 34 base::Closure quit_closure_; |
| 35 bool report_set_; |
32 | 36 |
33 DISALLOW_COPY_AND_ASSIGN(MockPermissionReportSender); | 37 DISALLOW_COPY_AND_ASSIGN(MockPermissionReportSender); |
34 }; | 38 }; |
35 | 39 |
36 } // namespace safe_browsing | 40 } // namespace safe_browsing |
37 | 41 |
38 #endif // CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ | 42 #endif // CHROME_BROWSER_SAFE_BROWSING_MOCK_PERMISSION_REPORT_SENDER_H_ |
OLD | NEW |