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

Unified Diff: net/url_request/url_request_throttler_test_support.h

Issue 1076853003: Refactor net::BackoffEntry to not require subclassing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address pneubeck's review comments Created 5 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
Index: net/url_request/url_request_throttler_test_support.h
diff --git a/net/url_request/url_request_throttler_test_support.h b/net/url_request/url_request_throttler_test_support.h
index a7103336c10159542d14334a673eac1af7c4c10f..9331c4b6218045b609ea6faa24e7022f160b5c72 100644
--- a/net/url_request/url_request_throttler_test_support.h
+++ b/net/url_request/url_request_throttler_test_support.h
@@ -7,24 +7,26 @@
#include <string>
+#include "base/macros.h"
+#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "net/base/backoff_entry.h"
#include "net/url_request/url_request_throttler_header_interface.h"
namespace net {
-class MockBackoffEntry : public BackoffEntry {
+class TestTickClock : public base::TickClock {
public:
- explicit MockBackoffEntry(const BackoffEntry::Policy* const policy);
- ~MockBackoffEntry() override;
+ TestTickClock();
+ explicit TestTickClock(base::TimeTicks now);
+ ~TestTickClock() override;
- // BackoffEntry overrides.
- base::TimeTicks ImplGetTimeNow() const override;
-
- void set_fake_now(const base::TimeTicks& now);
+ base::TimeTicks NowTicks() override;
+ void set_now(base::TimeTicks now) { now_ticks_ = now; }
private:
- base::TimeTicks fake_now_;
+ base::TimeTicks now_ticks_;
+ DISALLOW_COPY_AND_ASSIGN(TestTickClock);
};
// Mocks the URLRequestThrottlerHeaderInterface, allowing testing code to
« no previous file with comments | « net/url_request/url_request_throttler_simulation_unittest.cc ('k') | net/url_request/url_request_throttler_test_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698