Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver.h

Issue 891793002: Take a Profile when adding an incident to the incident reporting service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: this time Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H _
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H _
7
8 #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h"
9 #include "testing/gmock/include/gmock/gmock.h"
10
11 namespace safe_browsing {
12
13 class MockIncidentReceiver : public IncidentReceiver {
14 public:
15 MockIncidentReceiver();
16 ~MockIncidentReceiver();
17
18 MOCK_METHOD2(DoAddIncidentForProfile, void(Profile*, scoped_ptr<Incident>*));
19 MOCK_METHOD1(DoAddIncidentForProcess, void(scoped_ptr<Incident>*));
20
21 protected:
22 void AddIncidentForProfile(Profile* profile,
23 scoped_ptr<Incident> incident) override {
24 DoAddIncidentForProfile(profile, &incident);
25 }
26
27 void AddIncidentForProcess(scoped_ptr<Incident> incident) override {
28 DoAddIncidentForProcess(&incident);
29 }
30 };
31
32 // An action that passes ownership of the incident in |arg0| to |recipient|.
33 ACTION_P(TakeIncident, recipient) {
34 *recipient = arg0->Pass();
35 }
36
37 // An action that passes ownership of the incident in |arg0| to the vector in
38 // |incidents|.
39 ACTION_P(TakeIncidentToVector, incidents) {
40 incidents->push_back(arg0->release());
41 }
42
43 } // namespace safe_browsing
44
45 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVE R_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698