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

Side by Side Diff: net/url_request/url_request_unittest.h

Issue 115029: Making command-line specified proxy settings more flexible - allowing for set... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | webkit/tools/test_shell/test_shell_request_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_
6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_
7 7
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <sstream> 10 #include <sstream>
(...skipping 30 matching lines...) Expand all
41 // This URLRequestContext does not use a local cache. 41 // This URLRequestContext does not use a local cache.
42 class TestURLRequestContext : public URLRequestContext { 42 class TestURLRequestContext : public URLRequestContext {
43 public: 43 public:
44 TestURLRequestContext() { 44 TestURLRequestContext() {
45 proxy_service_ = net::ProxyService::CreateNull(); 45 proxy_service_ = net::ProxyService::CreateNull();
46 http_transaction_factory_ = 46 http_transaction_factory_ =
47 net::HttpNetworkLayer::CreateFactory(proxy_service_); 47 net::HttpNetworkLayer::CreateFactory(proxy_service_);
48 } 48 }
49 49
50 explicit TestURLRequestContext(const std::string& proxy) { 50 explicit TestURLRequestContext(const std::string& proxy) {
51 net::ProxyInfo proxy_info; 51 net::ProxyConfig proxy_config;
52 proxy_info.UseNamedProxy(proxy); 52 proxy_config.proxy_rules.ParseFromString(proxy);
53 proxy_service_ = net::ProxyService::Create(&proxy_info); 53 proxy_service_ = net::ProxyService::Create(&proxy_config);
54 http_transaction_factory_ = 54 http_transaction_factory_ =
55 net::HttpNetworkLayer::CreateFactory(proxy_service_); 55 net::HttpNetworkLayer::CreateFactory(proxy_service_);
56 } 56 }
57 57
58 virtual ~TestURLRequestContext() { 58 virtual ~TestURLRequestContext() {
59 delete http_transaction_factory_; 59 delete http_transaction_factory_;
60 delete proxy_service_; 60 delete proxy_service_;
61 } 61 }
62 }; 62 };
63 63
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 request.set_method("GET"); 541 request.set_method("GET");
542 request.Start(); 542 request.Start();
543 EXPECT_TRUE(request.is_pending()); 543 EXPECT_TRUE(request.is_pending());
544 544
545 MessageLoop::current()->Run(); 545 MessageLoop::current()->Run();
546 if (request.is_pending()) 546 if (request.is_pending())
547 return false; 547 return false;
548 548
549 return true; 549 return true;
550 } 550 }
551
552 }; 551 };
553 552
554 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ 553 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_
OLDNEW
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | webkit/tools/test_shell/test_shell_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698