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

Side by Side Diff: chrome/browser/safe_browsing/mock_report_sender.cc

Issue 2164513002: Add browsertest for permission action reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-hooks-to-permission-layer2
Patch Set: Resolve nits Created 4 years, 4 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 2016 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 #include "chrome/browser/safe_browsing/mock_report_sender.h"
6
7 namespace safe_browsing {
8
9 MockReportSender::MockReportSender()
10 : net::ReportSender(nullptr, DO_NOT_SEND_COOKIES) {
11 number_of_reports_ = 0;
12 }
13
14 MockReportSender::~MockReportSender() {}
15
16 void MockReportSender::Send(const GURL& report_uri, const std::string& report) {
17 latest_report_uri_ = report_uri;
18 latest_report_ = report;
19 number_of_reports_++;
20 }
21
22 const GURL& MockReportSender::latest_report_uri() {
23 return latest_report_uri_;
24 }
25
26 const std::string& MockReportSender::latest_report() {
27 return latest_report_;
28 }
29
30 int MockReportSender::GetAndResetNumberOfReportsSent() {
31 int new_reports = number_of_reports_;
32 number_of_reports_ = 0;
33 return new_reports;
34 }
35
36 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698