Refactor WebsiteSettings to operate on a SecurityInfo
[chromium-blink-merge.git] / chrome / browser / safe_browsing / incident_reporting / mock_incident_receiver.h
blob1cd2e05324545bef69b9af447f2be29b3762260f
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.
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H_
8 #include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h"
9 #include "testing/gmock/include/gmock/gmock.h"
11 namespace safe_browsing {
13 class MockIncidentReceiver : public IncidentReceiver {
14 public:
15 MockIncidentReceiver();
16 ~MockIncidentReceiver();
18 MOCK_METHOD2(DoAddIncidentForProfile, void(Profile*, scoped_ptr<Incident>*));
19 MOCK_METHOD1(DoAddIncidentForProcess, void(scoped_ptr<Incident>*));
21 protected:
22 void AddIncidentForProfile(Profile* profile,
23 scoped_ptr<Incident> incident) override {
24 DoAddIncidentForProfile(profile, &incident);
27 void AddIncidentForProcess(scoped_ptr<Incident> incident) override {
28 DoAddIncidentForProcess(&incident);
32 // An action that passes ownership of the incident in |arg0| to |recipient|.
33 ACTION_P(TakeIncident, recipient) {
34 *recipient = arg0->Pass();
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());
43 } // namespace safe_browsing
45 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H_