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

Unified Diff: net/reporting/reporting_test_util.cc

Issue 2891133003: Reporting: Wire ReportingDelegate into ChromeNetworkDelegate (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « net/reporting/reporting_test_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_test_util.cc
diff --git a/net/reporting/reporting_test_util.cc b/net/reporting/reporting_test_util.cc
index 2a7d1e0c8b61f8680d984c18b5a611ea3e0af51b..0b8237fbcf65d68a0876b4afddf04f26fdac6260 100644
--- a/net/reporting/reporting_test_util.cc
+++ b/net/reporting/reporting_test_util.cc
@@ -17,6 +17,7 @@
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_client.h"
#include "net/reporting/reporting_context.h"
+#include "net/reporting/reporting_delegate.h"
#include "net/reporting/reporting_delivery_agent.h"
#include "net/reporting/reporting_garbage_collector.h"
#include "net/reporting/reporting_persister.h"
@@ -103,11 +104,34 @@ void TestReportingUploader::StartUpload(const GURL& url,
url, json, callback, base::Bind(&ErasePendingUpload, &pending_uploads_)));
}
+TestReportingDelegate::TestReportingDelegate() {}
+
+TestReportingDelegate::~TestReportingDelegate() {}
+
+bool TestReportingDelegate::CanQueueReport(const url::Origin& origin) const {
+ return true;
+}
+
+bool TestReportingDelegate::CanSendReport(const url::Origin& origin) const {
+ return true;
+}
+
+bool TestReportingDelegate::CanSetClient(const url::Origin& origin,
+ const GURL& endpoint) const {
+ return true;
+}
+
+bool TestReportingDelegate::CanUseClient(const url::Origin& origin,
+ const GURL& endpoint) const {
+ return true;
+}
+
TestReportingContext::TestReportingContext(const ReportingPolicy& policy)
: ReportingContext(policy,
base::MakeUnique<base::SimpleTestClock>(),
base::MakeUnique<base::SimpleTestTickClock>(),
- base::MakeUnique<TestReportingUploader>()),
+ base::MakeUnique<TestReportingUploader>(),
+ base::MakeUnique<TestReportingDelegate>()),
delivery_timer_(new base::MockTimer(/* retain_user_task= */ false,
/* is_repeating= */ false)),
garbage_collection_timer_(
« no previous file with comments | « net/reporting/reporting_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698