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

Unified Diff: net/reporting/reporting_test_util.h

Issue 2785293003: Reporting: Make DeliveryAgent self-scheduling. (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 098fe0f4e21408d5dd02a9264d81218332c7c636..2fa0d46cfa75e6ce839eb4758be26046c267cce7 100644
--- a/net/reporting/reporting_test_util.h
+++ b/net/reporting/reporting_test_util.h
@@ -110,6 +110,7 @@ class TestReportingContext : public ReportingContext {
base::SimpleTestTickClock* test_tick_clock() {
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_;
@@ -122,6 +123,7 @@ class TestReportingContext : public ReportingContext {
// Owned by the Persister and GarbageCollector, respectively, but referenced
// here to preserve type:
+ base::MockTimer* delivery_timer_;
base::MockTimer* persistence_timer_;
base::MockTimer* garbage_collection_timer_;
@@ -153,6 +155,7 @@ class ReportingTestBase : public ::testing::Test {
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();
}
@@ -175,9 +178,14 @@ class ReportingTestBase : public ::testing::Test {
ReportingPersister* persister() { return context_->persister(); }
base::TimeTicks yesterday();
-
+ base::TimeTicks now();
base::TimeTicks tomorrow();
+ const std::vector<std::unique_ptr<TestReportingUploader::PendingUpload>>&
+ pending_uploads() {
+ return uploader()->pending_uploads();
+ }
+
private:
void CreateAndInitializeContext(
const ReportingPolicy& policy,
« 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