| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |