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

Unified Diff: google_apis/gcm/engine/connection_factory_impl_unittest.cc

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
« no previous file with comments | « components/password_manager/core/browser/affiliation_fetch_throttler.cc ('k') | net/base/backoff_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/engine/connection_factory_impl_unittest.cc
diff --git a/google_apis/gcm/engine/connection_factory_impl_unittest.cc b/google_apis/gcm/engine/connection_factory_impl_unittest.cc
index ed23da9f07e1367a29c9f02e9bdf8ee6c60af54c..4c0e127bd63e4522f2d26a810e7020c235bed179 100644
--- a/google_apis/gcm/engine/connection_factory_impl_unittest.cc
+++ b/google_apis/gcm/engine/connection_factory_impl_unittest.cc
@@ -80,28 +80,6 @@ void ReadContinuation(
void WriteContinuation() {
}
-class TestBackoffEntry : public net::BackoffEntry {
- public:
- explicit TestBackoffEntry(base::SimpleTestTickClock* tick_clock);
- ~TestBackoffEntry() override;
-
- base::TimeTicks ImplGetTimeNow() const override;
-
- private:
- base::SimpleTestTickClock* tick_clock_;
-};
-
-TestBackoffEntry::TestBackoffEntry(base::SimpleTestTickClock* tick_clock)
- : BackoffEntry(&kTestBackoffPolicy),
- tick_clock_(tick_clock) {
-}
-
-TestBackoffEntry::~TestBackoffEntry() {}
-
-base::TimeTicks TestBackoffEntry::ImplGetTimeNow() const {
- return tick_clock_->NowTicks();
-}
-
// A connection factory that stubs out network requests and overrides the
// backoff policy.
class TestConnectionFactoryImpl : public ConnectionFactoryImpl {
@@ -213,7 +191,8 @@ void TestConnectionFactoryImpl::InitHandler() {
scoped_ptr<net::BackoffEntry> TestConnectionFactoryImpl::CreateBackoffEntry(
const net::BackoffEntry::Policy* const policy) {
- return scoped_ptr<net::BackoffEntry>(new TestBackoffEntry(&tick_clock_));
+ return make_scoped_ptr(new net::BackoffEntry(&kTestBackoffPolicy,
+ &tick_clock_));
}
scoped_ptr<ConnectionHandler>
« no previous file with comments | « components/password_manager/core/browser/affiliation_fetch_throttler.cc ('k') | net/base/backoff_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698