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

Unified Diff: net/reporting/reporting_test_util.h

Issue 2740833004: Reporting: Implement garbage collector. (Closed)
Patch Set: rebase Created 3 years, 8 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_policy.cc ('k') | net/reporting/reporting_test_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/reporting/reporting_test_util.h
diff --git a/net/reporting/reporting_test_util.h b/net/reporting/reporting_test_util.h
index 9aeaa2e28b29b354e7a71ce450155eba15fa90f8..7997d5e2a736b2c2980ca900fcb2267a6df2e885 100644
--- a/net/reporting/reporting_test_util.h
+++ b/net/reporting/reporting_test_util.h
@@ -18,6 +18,7 @@
class GURL;
namespace base {
+class MockTimer;
class SimpleTestClock;
class SimpleTestTickClock;
class Value;
@@ -31,6 +32,7 @@ namespace net {
class ReportingCache;
struct ReportingClient;
+class ReportingGarbageCollector;
// Finds a particular client (by origin and endpoint) in the cache and returns
// it (or nullptr if not found).
@@ -108,11 +110,17 @@ class TestReportingContext : public ReportingContext {
base::SimpleTestTickClock* test_tick_clock() {
return reinterpret_cast<base::SimpleTestTickClock*>(tick_clock());
}
+ base::MockTimer* test_garbage_collection_timer() {
+ return garbage_collection_timer_;
+ }
TestReportingUploader* test_uploader() {
return reinterpret_cast<TestReportingUploader*>(uploader());
}
private:
+ // Owned by the garbage collector but referenced here to preserve type.
+ base::MockTimer* garbage_collection_timer_;
+
DISALLOW_COPY_AND_ASSIGN(TestReportingContext);
};
@@ -134,6 +142,9 @@ class ReportingTestBase : public ::testing::Test {
base::SimpleTestTickClock* tick_clock() {
return context_->test_tick_clock();
}
+ base::MockTimer* garbage_collection_timer() {
+ return context_->test_garbage_collection_timer();
+ }
TestReportingUploader* uploader() { return context_->test_uploader(); }
ReportingCache* cache() { return context_->cache(); }
@@ -143,6 +154,9 @@ class ReportingTestBase : public ::testing::Test {
ReportingDeliveryAgent* delivery_agent() {
return context_->delivery_agent();
}
+ ReportingGarbageCollector* garbage_collector() {
+ return context_->garbage_collector();
+ }
base::TimeTicks yesterday();
« no previous file with comments | « net/reporting/reporting_policy.cc ('k') | net/reporting/reporting_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698