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

Side by Side Diff: net/url_request/url_request_throttler_test_support.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/url_request/url_request_throttler_test_support.h"
6
7 #include "net/url_request/url_request_throttler_entry.h"
8
9 namespace net {
10
11 MockBackoffEntry::MockBackoffEntry(const BackoffEntry::Policy* const policy)
12 : BackoffEntry(policy) {
13 }
14
15 MockBackoffEntry::~MockBackoffEntry() {
16 }
17
18 base::TimeTicks MockBackoffEntry::ImplGetTimeNow() const {
19 return fake_now_;
20 }
21
22 void MockBackoffEntry::set_fake_now(const base::TimeTicks& now) {
23 fake_now_ = now;
24 }
25
26 MockURLRequestThrottlerHeaderAdapter::MockURLRequestThrottlerHeaderAdapter(
27 int response_code)
28 : fake_response_code_(response_code) {
29 }
30
31 MockURLRequestThrottlerHeaderAdapter::MockURLRequestThrottlerHeaderAdapter(
32 const std::string& retry_value,
33 const std::string& opt_out_value,
34 int response_code)
35 : fake_retry_value_(retry_value),
36 fake_opt_out_value_(opt_out_value),
37 fake_response_code_(response_code) {
38 }
39
40 MockURLRequestThrottlerHeaderAdapter::~MockURLRequestThrottlerHeaderAdapter() {
41 }
42
43 std::string MockURLRequestThrottlerHeaderAdapter::GetNormalizedValue(
44 const std::string& key) const {
45 if (key ==
46 URLRequestThrottlerEntry::kExponentialThrottlingHeader &&
47 !fake_opt_out_value_.empty()) {
48 return fake_opt_out_value_;
49 }
50
51 return std::string();
52 }
53
54 int MockURLRequestThrottlerHeaderAdapter::GetResponseCode() const {
55 return fake_response_code_;
56 }
57
58 } // 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