OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H
_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H
_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H
_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H
_ |
7 | 7 |
| 8 #include <utility> |
| 9 |
8 #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h" | 10 #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
10 | 12 |
11 namespace safe_browsing { | 13 namespace safe_browsing { |
12 | 14 |
13 class MockIncidentReceiver : public IncidentReceiver { | 15 class MockIncidentReceiver : public IncidentReceiver { |
14 public: | 16 public: |
15 MockIncidentReceiver(); | 17 MockIncidentReceiver(); |
16 ~MockIncidentReceiver(); | 18 ~MockIncidentReceiver(); |
17 | 19 |
(...skipping 11 matching lines...) Expand all Loading... |
29 DoAddIncidentForProcess(&incident); | 31 DoAddIncidentForProcess(&incident); |
30 } | 32 } |
31 | 33 |
32 void ClearIncidentForProcess(scoped_ptr<Incident> incident) override { | 34 void ClearIncidentForProcess(scoped_ptr<Incident> incident) override { |
33 DoClearIncidentForProcess(&incident); | 35 DoClearIncidentForProcess(&incident); |
34 } | 36 } |
35 }; | 37 }; |
36 | 38 |
37 // An action that passes ownership of the incident in |arg0| to |recipient|. | 39 // An action that passes ownership of the incident in |arg0| to |recipient|. |
38 ACTION_P(TakeIncident, recipient) { | 40 ACTION_P(TakeIncident, recipient) { |
39 *recipient = arg0->Pass(); | 41 *recipient = std::move(*arg0); |
40 } | 42 } |
41 | 43 |
42 // An action that passes ownership of the incident in |arg0| to the vector in | 44 // An action that passes ownership of the incident in |arg0| to the vector in |
43 // |incidents|. | 45 // |incidents|. |
44 ACTION_P(TakeIncidentToVector, incidents) { | 46 ACTION_P(TakeIncidentToVector, incidents) { |
45 incidents->push_back(arg0->Pass()); | 47 incidents->push_back(std::move(*arg0)); |
46 } | 48 } |
47 | 49 |
48 } // namespace safe_browsing | 50 } // namespace safe_browsing |
49 | 51 |
50 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVE
R_H_ | 52 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVE
R_H_ |
OLD | NEW |