| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_REPORTING_REPORTING_TEST_UTIL_H_ | 5 #ifndef NET_REPORTING_REPORTING_TEST_UTIL_H_ |
| 6 #define NET_REPORTING_REPORTING_TEST_UTIL_H_ | 6 #define NET_REPORTING_REPORTING_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class SimpleTestTickClock; | 23 class SimpleTestTickClock; |
| 24 class Value; | 24 class Value; |
| 25 } // namespace base | 25 } // namespace base |
| 26 | 26 |
| 27 namespace url { | 27 namespace url { |
| 28 class Origin; | 28 class Origin; |
| 29 } // namespace url | 29 } // namespace url |
| 30 | 30 |
| 31 namespace net { | 31 namespace net { |
| 32 | 32 |
| 33 class ReportingBrowsingDataRemover; |
| 33 class ReportingCache; | 34 class ReportingCache; |
| 34 struct ReportingClient; | 35 struct ReportingClient; |
| 35 class ReportingGarbageCollector; | 36 class ReportingGarbageCollector; |
| 36 | 37 |
| 37 // Finds a particular client (by origin and endpoint) in the cache and returns | 38 // Finds a particular client (by origin and endpoint) in the cache and returns |
| 38 // it (or nullptr if not found). | 39 // it (or nullptr if not found). |
| 39 const ReportingClient* FindClientInCache(const ReportingCache* cache, | 40 const ReportingClient* FindClientInCache(const ReportingCache* cache, |
| 40 const url::Origin& origin, | 41 const url::Origin& origin, |
| 41 const GURL& endpoint); | 42 const GURL& endpoint); |
| 42 | 43 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 ReportingCache* cache() { return context_->cache(); } | 165 ReportingCache* cache() { return context_->cache(); } |
| 165 ReportingEndpointManager* endpoint_manager() { | 166 ReportingEndpointManager* endpoint_manager() { |
| 166 return context_->endpoint_manager(); | 167 return context_->endpoint_manager(); |
| 167 } | 168 } |
| 168 ReportingDeliveryAgent* delivery_agent() { | 169 ReportingDeliveryAgent* delivery_agent() { |
| 169 return context_->delivery_agent(); | 170 return context_->delivery_agent(); |
| 170 } | 171 } |
| 171 ReportingGarbageCollector* garbage_collector() { | 172 ReportingGarbageCollector* garbage_collector() { |
| 172 return context_->garbage_collector(); | 173 return context_->garbage_collector(); |
| 173 } | 174 } |
| 175 ReportingBrowsingDataRemover* browsing_data_remover() { |
| 176 return context_->browsing_data_remover(); |
| 177 } |
| 174 | 178 |
| 175 ReportingPersister* persister() { return context_->persister(); } | 179 ReportingPersister* persister() { return context_->persister(); } |
| 176 | 180 |
| 177 base::TimeTicks yesterday(); | 181 base::TimeTicks yesterday(); |
| 178 | 182 |
| 179 base::TimeTicks tomorrow(); | 183 base::TimeTicks tomorrow(); |
| 180 | 184 |
| 181 private: | 185 private: |
| 182 void CreateAndInitializeContext( | 186 void CreateAndInitializeContext( |
| 183 const ReportingPolicy& policy, | 187 const ReportingPolicy& policy, |
| 184 std::unique_ptr<const base::Value> persisted_data, | 188 std::unique_ptr<const base::Value> persisted_data, |
| 185 base::Time now, | 189 base::Time now, |
| 186 base::TimeTicks now_ticks); | 190 base::TimeTicks now_ticks); |
| 187 | 191 |
| 188 std::unique_ptr<TestReportingContext> context_; | 192 std::unique_ptr<TestReportingContext> context_; |
| 189 | 193 |
| 190 DISALLOW_COPY_AND_ASSIGN(ReportingTestBase); | 194 DISALLOW_COPY_AND_ASSIGN(ReportingTestBase); |
| 191 }; | 195 }; |
| 192 | 196 |
| 193 } // namespace net | 197 } // namespace net |
| 194 | 198 |
| 195 #endif // NET_REPORING_REPORTING_TEST_UTIL_H_ | 199 #endif // NET_REPORING_REPORTING_TEST_UTIL_H_ |
| OLD | NEW |