Index: net/reporting/reporting_test_util.h |
diff --git a/net/reporting/reporting_test_util.h b/net/reporting/reporting_test_util.h |
index 2fa0d46cfa75e6ce839eb4758be26046c267cce7..48b63d9b6204934b3f7fba49f8f235fb116e5693 100644 |
--- a/net/reporting/reporting_test_util.h |
+++ b/net/reporting/reporting_test_util.h |
@@ -11,7 +11,6 @@ |
#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" |
@@ -40,24 +39,6 @@ const ReportingClient* FindClientInCache(const ReportingCache* cache, |
const url::Origin& origin, |
const GURL& endpoint); |
-// A simple implementation of ReportingDelegate that only persists data in RAM. |
-class TestReportingDelegate : public ReportingDelegate { |
- public: |
- TestReportingDelegate(); |
- |
- ~TestReportingDelegate() override; |
- |
- // ReportingDelegate implementation: |
- std::unique_ptr<const base::Value> GetPersistedData() override; |
- |
- void PersistData(std::unique_ptr<const base::Value> persisted_data) override; |
- |
- private: |
- std::unique_ptr<const base::Value> persisted_data_; |
- |
- DISALLOW_COPY_AND_ASSIGN(TestReportingDelegate); |
-}; |
- |
// A test implementation of ReportingUploader that holds uploads for tests to |
// examine and complete with a specified outcome. |
class TestReportingUploader : public ReportingUploader { |
@@ -95,15 +76,12 @@ class TestReportingUploader : public ReportingUploader { |
}; |
// A test implementation of ReportingContext that uses test versions of |
-// ReportingDelegate, Clock, TickClock, and ReportingUploader. |
+// Clock, TickClock, Timer, and ReportingUploader. |
class TestReportingContext : public ReportingContext { |
public: |
TestReportingContext(const ReportingPolicy& policy); |
~TestReportingContext(); |
- TestReportingDelegate* test_delegate() { |
- return reinterpret_cast<TestReportingDelegate*>(delegate()); |
- } |
base::SimpleTestClock* test_clock() { |
return reinterpret_cast<base::SimpleTestClock*>(clock()); |
} |
@@ -111,7 +89,6 @@ class TestReportingContext : public ReportingContext { |
return reinterpret_cast<base::SimpleTestTickClock*>(tick_clock()); |
} |
base::MockTimer* test_delivery_timer() { return delivery_timer_; } |
- base::MockTimer* test_persistence_timer() { return persistence_timer_; } |
base::MockTimer* test_garbage_collection_timer() { |
return garbage_collection_timer_; |
} |
@@ -124,7 +101,6 @@ class TestReportingContext : public ReportingContext { |
// here to preserve type: |
base::MockTimer* delivery_timer_; |
- base::MockTimer* persistence_timer_; |
base::MockTimer* garbage_collection_timer_; |
DISALLOW_COPY_AND_ASSIGN(TestReportingContext); |
@@ -139,8 +115,7 @@ class ReportingTestBase : public ::testing::Test { |
void UsePolicy(const ReportingPolicy& policy); |
- // Simulates an embedder restart, preserving the ReportingPolicy and any data |
- // persisted via the TestReportingDelegate, but nothing else. |
+ // Simulates an embedder restart, preserving the ReportingPolicy. |
// |
// Advances the Clock by |delta|, and the TickClock by |delta_ticks|. Both can |
// be zero or negative. |
@@ -150,15 +125,11 @@ class ReportingTestBase : public ::testing::Test { |
const ReportingPolicy& policy() { return context_->policy(); } |
- TestReportingDelegate* delegate() { return context_->test_delegate(); } |
base::SimpleTestClock* clock() { return context_->test_clock(); } |
base::SimpleTestTickClock* tick_clock() { |
return context_->test_tick_clock(); |
} |
base::MockTimer* delivery_timer() { return context_->test_delivery_timer(); } |
- base::MockTimer* persistence_timer() { |
- return context_->test_persistence_timer(); |
- } |
base::MockTimer* garbage_collection_timer() { |
return context_->test_garbage_collection_timer(); |
} |
@@ -187,11 +158,9 @@ class ReportingTestBase : public ::testing::Test { |
} |
private: |
- void CreateAndInitializeContext( |
- const ReportingPolicy& policy, |
- std::unique_ptr<const base::Value> persisted_data, |
- base::Time now, |
- base::TimeTicks now_ticks); |
+ void CreateContext(const ReportingPolicy& policy, |
+ base::Time now, |
+ base::TimeTicks now_ticks); |
std::unique_ptr<TestReportingContext> context_; |