OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/data_reduction_proxy/content/browser/data_reduction_proxy_d
ebug_resource_throttle.h" | 5 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_d
ebug_resource_throttle.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "components/data_reduction_proxy/content/browser/content_data_reduction
_proxy_debug_ui_service.h" | 10 #include "components/data_reduction_proxy/content/browser/content_data_reduction
_proxy_debug_ui_service.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 TestDataReductionProxyDebugResourceThrottle* throttle() const { | 99 TestDataReductionProxyDebugResourceThrottle* throttle() const { |
100 return resource_throttle_.get(); | 100 return resource_throttle_.get(); |
101 } | 101 } |
102 | 102 |
103 net::URLRequest* request() const { | 103 net::URLRequest* request() const { |
104 return request_.get(); | 104 return request_.get(); |
105 } | 105 } |
106 | 106 |
107 private: | 107 private: |
| 108 base::MessageLoop message_loop_; |
108 net::TestURLRequestContext context_; | 109 net::TestURLRequestContext context_; |
109 net::TestDelegate delegate_; | 110 net::TestDelegate delegate_; |
110 // |test_job_interceptor_| is owned by |test_job_factory_|. | 111 // |test_job_interceptor_| is owned by |test_job_factory_|. |
111 net::TestJobInterceptor* test_job_interceptor_; | 112 net::TestJobInterceptor* test_job_interceptor_; |
112 net::URLRequestJobFactoryImpl test_job_factory_; | 113 net::URLRequestJobFactoryImpl test_job_factory_; |
113 | 114 |
114 net::ProxyConfig proxy_config_; | 115 net::ProxyConfig proxy_config_; |
115 scoped_ptr<net::URLRequest> request_; | 116 scoped_ptr<net::URLRequest> request_; |
116 scoped_ptr<ContentDataReductionProxyDebugUIService> ui_service_; | 117 scoped_ptr<ContentDataReductionProxyDebugUIService> ui_service_; |
117 scoped_ptr<TestDataReductionProxyDebugResourceThrottle> resource_throttle_; | 118 scoped_ptr<TestDataReductionProxyDebugResourceThrottle> resource_throttle_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 bool defer = false; | 168 bool defer = false; |
168 throttle()->WillRedirectRequest(net::RedirectInfo(), &defer); | 169 throttle()->WillRedirectRequest(net::RedirectInfo(), &defer); |
169 EXPECT_FALSE(defer); | 170 EXPECT_FALSE(defer); |
170 | 171 |
171 request()->SetLoadFlags(net::LOAD_BYPASS_PROXY); | 172 request()->SetLoadFlags(net::LOAD_BYPASS_PROXY); |
172 throttle()->WillRedirectRequest(net::RedirectInfo(), &defer); | 173 throttle()->WillRedirectRequest(net::RedirectInfo(), &defer); |
173 EXPECT_TRUE(defer); | 174 EXPECT_TRUE(defer); |
174 } | 175 } |
175 | 176 |
176 } // namespace data_reduction_proxy | 177 } // namespace data_reduction_proxy |
OLD | NEW |