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

Side by Side Diff: net/url_request/url_request_throttler_test_support.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "net/url_request/url_request_throttler_test_support.h" 5 #include "net/url_request/url_request_throttler_test_support.h"
6 6
7 #include "net/url_request/url_request_throttler_entry.h" 7 #include "net/url_request/url_request_throttler_entry.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 MockBackoffEntry::MockBackoffEntry(const BackoffEntry::Policy* const policy) 11 TestTickClock::TestTickClock() {}
12 : BackoffEntry(policy) {
13 }
14 12
15 MockBackoffEntry::~MockBackoffEntry() { 13 TestTickClock::TestTickClock(base::TimeTicks now) : now_ticks_(now) {}
16 }
17 14
18 base::TimeTicks MockBackoffEntry::ImplGetTimeNow() const { 15 TestTickClock::~TestTickClock() {}
19 return fake_now_;
20 }
21 16
22 void MockBackoffEntry::set_fake_now(const base::TimeTicks& now) { 17 base::TimeTicks TestTickClock::NowTicks() {
23 fake_now_ = now; 18 return now_ticks_;
24 } 19 }
25 20
26 MockURLRequestThrottlerHeaderAdapter::MockURLRequestThrottlerHeaderAdapter( 21 MockURLRequestThrottlerHeaderAdapter::MockURLRequestThrottlerHeaderAdapter(
27 int response_code) 22 int response_code)
28 : fake_response_code_(response_code) { 23 : fake_response_code_(response_code) {
29 } 24 }
30 25
31 MockURLRequestThrottlerHeaderAdapter::MockURLRequestThrottlerHeaderAdapter( 26 MockURLRequestThrottlerHeaderAdapter::MockURLRequestThrottlerHeaderAdapter(
32 const std::string& retry_value, 27 const std::string& retry_value,
33 const std::string& opt_out_value, 28 const std::string& opt_out_value,
(...skipping 15 matching lines...) Expand all
49 } 44 }
50 45
51 return std::string(); 46 return std::string();
52 } 47 }
53 48
54 int MockURLRequestThrottlerHeaderAdapter::GetResponseCode() const { 49 int MockURLRequestThrottlerHeaderAdapter::GetResponseCode() const {
55 return fake_response_code_; 50 return fake_response_code_;
56 } 51 }
57 52
58 } // namespace net 53 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_throttler_test_support.h ('k') | net/url_request/url_request_throttler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698