Index: net/reporting/reporting_test_util.h |
diff --git a/net/reporting/reporting_test_util.h b/net/reporting/reporting_test_util.h |
index 6e64870fb73e3b02b72bea8e7570c2b402339389..9343278954de5a4f52937c614b9b8a84ba3d481c 100644 |
--- a/net/reporting/reporting_test_util.h |
+++ b/net/reporting/reporting_test_util.h |
@@ -11,6 +11,7 @@ |
#include "base/macros.h" |
#include "net/reporting/reporting_context.h" |
+#include "net/reporting/reporting_delegate.h" |
#include "net/reporting/reporting_uploader.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -76,6 +77,28 @@ class TestReportingUploader : public ReportingUploader { |
DISALLOW_COPY_AND_ASSIGN(TestReportingUploader); |
}; |
+class TestReportingDelegate : public ReportingDelegate { |
+ public: |
+ TestReportingDelegate(); |
+ |
+ // ReportingDelegate implementation: |
+ |
+ ~TestReportingDelegate() override; |
+ |
+ bool CanQueueReport(const url::Origin& origin) const override; |
+ |
+ bool CanSendReport(const url::Origin& origin) const override; |
+ |
+ bool CanSetClient(const url::Origin& origin, |
+ const GURL& endpoint) const override; |
+ |
+ bool CanUseClient(const url::Origin& origin, |
+ const GURL& endpoint) const override; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(TestReportingDelegate); |
+}; |
+ |
// A test implementation of ReportingContext that uses test versions of |
// Clock, TickClock, Timer, and ReportingUploader. |
class TestReportingContext : public ReportingContext { |
@@ -96,6 +119,9 @@ class TestReportingContext : public ReportingContext { |
TestReportingUploader* test_uploader() { |
return reinterpret_cast<TestReportingUploader*>(uploader()); |
} |
+ TestReportingDelegate* test_delegate() { |
+ return reinterpret_cast<TestReportingDelegate*>(delegate()); |
+ } |
private: |
// Owned by the Persister and GarbageCollector, respectively, but referenced |