OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/base/layered_network_delegate.h" | 5 #include "net/base/layered_network_delegate.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 context_(true), | 178 context_(true), |
179 counters_(counters) { | 179 counters_(counters) { |
180 context_.Init(); | 180 context_.Init(); |
181 } | 181 } |
182 | 182 |
183 ~TestLayeredNetworkDelegate() override {} | 183 ~TestLayeredNetworkDelegate() override {} |
184 | 184 |
185 void CallAndVerify() { | 185 void CallAndVerify() { |
186 scoped_refptr<AuthChallengeInfo> auth_challenge(new AuthChallengeInfo()); | 186 scoped_refptr<AuthChallengeInfo> auth_challenge(new AuthChallengeInfo()); |
187 scoped_ptr<URLRequest> request = | 187 scoped_ptr<URLRequest> request = |
188 context_.CreateRequest(GURL(), IDLE, &delegate_, NULL); | 188 context_.CreateRequest(GURL(), IDLE, &delegate_); |
189 scoped_ptr<HttpRequestHeaders> request_headers(new HttpRequestHeaders()); | 189 scoped_ptr<HttpRequestHeaders> request_headers(new HttpRequestHeaders()); |
190 scoped_refptr<HttpResponseHeaders> response_headers( | 190 scoped_refptr<HttpResponseHeaders> response_headers( |
191 new HttpResponseHeaders("")); | 191 new HttpResponseHeaders("")); |
192 TestCompletionCallback completion_callback; | 192 TestCompletionCallback completion_callback; |
193 scoped_ptr<ProxyService> proxy_service(ProxyService::CreateDirect()); | 193 scoped_ptr<ProxyService> proxy_service(ProxyService::CreateDirect()); |
194 scoped_ptr<ProxyInfo> proxy_info(new ProxyInfo()); | 194 scoped_ptr<ProxyInfo> proxy_info(new ProxyInfo()); |
195 | 195 |
196 EXPECT_EQ(OK, OnBeforeURLRequest(request.get(), | 196 EXPECT_EQ(OK, OnBeforeURLRequest(request.get(), |
197 completion_callback.callback(), NULL)); | 197 completion_callback.callback(), NULL)); |
198 OnResolveProxy(GURL(), 0, *proxy_service, proxy_info.get()); | 198 OnResolveProxy(GURL(), 0, *proxy_service, proxy_info.get()); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 CountersMap layered_network_delegate_counters; | 380 CountersMap layered_network_delegate_counters; |
381 TestNetworkDelegateImpl* test_network_delegate_; | 381 TestNetworkDelegateImpl* test_network_delegate_; |
382 scoped_ptr<TestLayeredNetworkDelegate> layered_network_delegate_; | 382 scoped_ptr<TestLayeredNetworkDelegate> layered_network_delegate_; |
383 }; | 383 }; |
384 | 384 |
385 TEST_F(LayeredNetworkDelegateTest, VerifyLayeredNetworkDelegateInternal) { | 385 TEST_F(LayeredNetworkDelegateTest, VerifyLayeredNetworkDelegateInternal) { |
386 layered_network_delegate_->CallAndVerify(); | 386 layered_network_delegate_->CallAndVerify(); |
387 } | 387 } |
388 | 388 |
389 } // namespace net | 389 } // namespace net |
OLD | NEW |