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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver.h
diff --git a/chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver.h b/chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver.h
new file mode 100644
index 0000000000000000000000000000000000000000..1cd2e05324545bef69b9af447f2be29b3762260f
--- /dev/null
+++ b/chrome/browser/safe_browsing/incident_reporting/mock_incident_receiver.h
@@ -0,0 +1,45 @@
+// Copyright 2015 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_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H_
+#define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H_
+
+#include "chrome/browser/safe_browsing/incident_reporting/incident_receiver.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace safe_browsing {
+
+class MockIncidentReceiver : public IncidentReceiver {
+ public:
+ MockIncidentReceiver();
+ ~MockIncidentReceiver();
+
+ MOCK_METHOD2(DoAddIncidentForProfile, void(Profile*, scoped_ptr<Incident>*));
+ MOCK_METHOD1(DoAddIncidentForProcess, void(scoped_ptr<Incident>*));
+
+ protected:
+ void AddIncidentForProfile(Profile* profile,
+ scoped_ptr<Incident> incident) override {
+ DoAddIncidentForProfile(profile, &incident);
+ }
+
+ void AddIncidentForProcess(scoped_ptr<Incident> incident) override {
+ DoAddIncidentForProcess(&incident);
+ }
+};
+
+// An action that passes ownership of the incident in |arg0| to |recipient|.
+ACTION_P(TakeIncident, recipient) {
+ *recipient = arg0->Pass();
+}
+
+// An action that passes ownership of the incident in |arg0| to the vector in
+// |incidents|.
+ACTION_P(TakeIncidentToVector, incidents) {
+ incidents->push_back(arg0->release());
+}
+
+} // namespace safe_browsing
+
+#endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_MOCK_INCIDENT_RECEIVER_H_

Powered by Google App Engine
This is Rietveld 408576698