OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "googleurl/src/gurl.h" | 6 #include "googleurl/src/gurl.h" |
7 #include "net/base/net_errors.h" | 7 #include "net/base/net_errors.h" |
8 #include "net/proxy/proxy_config_service.h" | 8 #include "net/proxy/proxy_config_service.h" |
9 #include "net/proxy/proxy_resolver.h" | 9 #include "net/proxy/proxy_resolver.h" |
10 #include "net/proxy/proxy_script_fetcher.h" | 10 #include "net/proxy/proxy_script_fetcher.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 bool HasPendingRequest() const { | 336 bool HasPendingRequest() const { |
337 return pending_request_loop_ != NULL; | 337 return pending_request_loop_ != NULL; |
338 } | 338 } |
339 | 339 |
340 MessageLoop* pending_request_loop_; | 340 MessageLoop* pending_request_loop_; |
341 GURL pending_request_url_; | 341 GURL pending_request_url_; |
342 net::CompletionCallback* pending_request_callback_; | 342 net::CompletionCallback* pending_request_callback_; |
343 std::string* pending_request_bytes_; | 343 std::string* pending_request_bytes_; |
344 }; | 344 }; |
345 | 345 |
346 // Template specialization so MockProxyScriptFetcher does not have to be refcoun
ted. | 346 // Template specialization so MockProxyScriptFetcher does not have to be |
| 347 // refcounted. |
347 template<> | 348 template<> |
348 void RunnableMethodTraits<MockProxyScriptFetcher>::RetainCallee( | 349 void RunnableMethodTraits<MockProxyScriptFetcher>::RetainCallee( |
349 MockProxyScriptFetcher* remover) {} | 350 MockProxyScriptFetcher* remover) {} |
350 template<> | 351 template<> |
351 void RunnableMethodTraits<MockProxyScriptFetcher>::ReleaseCallee( | 352 void RunnableMethodTraits<MockProxyScriptFetcher>::ReleaseCallee( |
352 MockProxyScriptFetcher* remover) {} | 353 MockProxyScriptFetcher* remover) {} |
353 | 354 |
354 TEST(ProxyServiceTest, Direct) { | 355 TEST(ProxyServiceTest, Direct) { |
355 SyncProxyService service(new MockProxyConfigService, | 356 SyncProxyService service(new MockProxyConfigService, |
356 new MockProxyResolver); | 357 new MockProxyResolver); |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 | 917 |
917 EXPECT_FALSE(result1->IsCompleted()); // Cancelled. | 918 EXPECT_FALSE(result1->IsCompleted()); // Cancelled. |
918 EXPECT_FALSE(result2->IsCompleted()); // Cancelled. | 919 EXPECT_FALSE(result2->IsCompleted()); // Cancelled. |
919 | 920 |
920 EXPECT_TRUE(result3->IsCompleted()); | 921 EXPECT_TRUE(result3->IsCompleted()); |
921 EXPECT_EQ(net::OK, result3->GetResultCode()); | 922 EXPECT_EQ(net::OK, result3->GetResultCode()); |
922 EXPECT_EQ("pac-v1.request3:80", | 923 EXPECT_EQ("pac-v1.request3:80", |
923 result3->GetProxyInfo().proxy_server().ToURI()); | 924 result3->GetProxyInfo().proxy_server().ToURI()); |
924 } | 925 } |
925 | 926 |
OLD | NEW |