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

Side by Side Diff: webkit/tools/test_shell/test_shell_request_context.cc

Issue 165091: Enable new FTP for Windows TestShell so that the results of block-test.html a... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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
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 #include "webkit/tools/test_shell/test_shell_request_context.h" 5 #include "webkit/tools/test_shell/test_shell_request_context.h"
6 6
7 #include "base/command_line.h"
8 #include "net/base/cookie_monster.h" 7 #include "net/base/cookie_monster.h"
9 #include "net/base/host_resolver.h" 8 #include "net/base/host_resolver.h"
10 #include "net/ftp/ftp_network_layer.h" 9 #include "net/ftp/ftp_network_layer.h"
11 #include "net/proxy/proxy_service.h" 10 #include "net/proxy/proxy_service.h"
12 #include "webkit/glue/webkit_glue.h" 11 #include "webkit/glue/webkit_glue.h"
13 #include "webkit/tools/test_shell/test_shell_switches.h"
14 12
15 TestShellRequestContext::TestShellRequestContext() { 13 TestShellRequestContext::TestShellRequestContext() {
16 Init(std::wstring(), net::HttpCache::NORMAL, false); 14 Init(std::wstring(), net::HttpCache::NORMAL, false);
17 } 15 }
18 16
19 TestShellRequestContext::TestShellRequestContext( 17 TestShellRequestContext::TestShellRequestContext(
20 const std::wstring& cache_path, 18 const std::wstring& cache_path,
21 net::HttpCache::Mode cache_mode, 19 net::HttpCache::Mode cache_mode,
22 bool no_proxy) { 20 bool no_proxy) {
23 Init(cache_path, cache_mode, no_proxy); 21 Init(cache_path, cache_mode, no_proxy);
(...skipping 27 matching lines...) Expand all
51 49
52 net::HttpCache *cache; 50 net::HttpCache *cache;
53 if (cache_path.empty()) { 51 if (cache_path.empty()) {
54 cache = new net::HttpCache(host_resolver_, proxy_service_, 0); 52 cache = new net::HttpCache(host_resolver_, proxy_service_, 0);
55 } else { 53 } else {
56 cache = new net::HttpCache(host_resolver_, proxy_service_, cache_path, 0); 54 cache = new net::HttpCache(host_resolver_, proxy_service_, cache_path, 0);
57 } 55 }
58 cache->set_mode(cache_mode); 56 cache->set_mode(cache_mode);
59 http_transaction_factory_ = cache; 57 http_transaction_factory_ = cache;
60 58
61 // The kNewFtp switch is Windows specific only because we have multiple FTP
62 // implementations on Windows.
63 #if defined(OS_WIN)
64 if (CommandLine::ForCurrentProcess()->HasSwitch(test_shell::kNewFtp))
65 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_);
66 #else
67 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_); 59 ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_);
68 #endif
69 } 60 }
70 61
71 TestShellRequestContext::~TestShellRequestContext() { 62 TestShellRequestContext::~TestShellRequestContext() {
72 delete cookie_store_; 63 delete cookie_store_;
73 delete ftp_transaction_factory_; 64 delete ftp_transaction_factory_;
74 delete http_transaction_factory_; 65 delete http_transaction_factory_;
75 delete proxy_service_; 66 delete proxy_service_;
76 } 67 }
77 68
78 const std::string& TestShellRequestContext::GetUserAgent( 69 const std::string& TestShellRequestContext::GetUserAgent(
79 const GURL& url) const { 70 const GURL& url) const {
80 return webkit_glue::GetUserAgent(url); 71 return webkit_glue::GetUserAgent(url);
81 } 72 }
OLDNEW
« no previous file with comments | « webkit/tools/layout_tests/test_expectations.txt ('k') | webkit/tools/test_shell/test_shell_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698