summaryrefslogtreecommitdiffstats
path: root/net/http/http_network_layer_unittest.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 04:11:27 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 04:11:27 +0000
commit63de95b265c665320b776c821f4cc44872c65c87 (patch)
treed60769b5e1907b060870af7d88ed567671a24e4e /net/http/http_network_layer_unittest.cc
parentbcdae8c9c9d90889fa0ca6491ae191a9e2f944b4 (diff)
downloadchromium_src-63de95b265c665320b776c821f4cc44872c65c87.zip
chromium_src-63de95b265c665320b776c821f4cc44872c65c87.tar.gz
chromium_src-63de95b265c665320b776c821f4cc44872c65c87.tar.bz2
Misc proxy service changes.
(1) Changed the proxy service ownership model -- rather than being a detail of the HTTP stack, it is now a dependency owned by UrlRequestContext. - ProxyService is owned by UrlRequestContext (before was HttpNetworkSession) - ProxyResolver is owned by ProxyService (before was HttpNetworkSession) Being able to share the proxy service is needed in several places, including incognito mode http context (http://crbug.com/3564), and for proxy resolving in the new FTP stack. (2) Added an IPC for getting of the ProxyResolverWinHttp dependency in the plugin process. Not hooked up yet, but intent is to route the proxy resolve requests through the browser process. (3) Changed some unit tests which were depending on the system proxy settings (this was a sideffect of their calling HttpNetworkLayer::CreateFactory(NULL)). (4) Moved the first-time ProxyService::UpdateConfig out of the constructor and into the initial request. Done to avoid startup perf regressions, since the ProxyService construction is now done earlier (on the startup critical path). BUG=3564 Review URL: http://codereview.chromium.org/12938 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_network_layer_unittest.cc')
-rw-r--r--net/http/http_network_layer_unittest.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc
index 2bccd8a..0460947 100644
--- a/net/http/http_network_layer_unittest.cc
+++ b/net/http/http_network_layer_unittest.cc
@@ -5,6 +5,7 @@
#include "net/base/scoped_host_mapper.h"
#include "net/http/http_network_layer.h"
#include "net/http/http_transaction_unittest.h"
+#include "net/proxy/proxy_resolver_null.h"
#include "net/proxy/proxy_service.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -21,13 +22,15 @@ class HttpNetworkLayerTest : public PlatformTest {
};
TEST_F(HttpNetworkLayerTest, CreateAndDestroy) {
- net::HttpNetworkLayer factory(NULL);
+ net::ProxyService proxy_service(new net::ProxyResolverNull);
+ net::HttpNetworkLayer factory(&proxy_service);
scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
}
TEST_F(HttpNetworkLayerTest, Suspend) {
- net::HttpNetworkLayer factory(NULL);
+ net::ProxyService proxy_service(new net::ProxyResolverNull);
+ net::HttpNetworkLayer factory(&proxy_service);
scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction());
trans.reset();
@@ -43,8 +46,8 @@ TEST_F(HttpNetworkLayerTest, Suspend) {
}
TEST_F(HttpNetworkLayerTest, GoogleGET) {
- net::ProxyInfo no_proxy; // Avoid using a proxy server.
- net::HttpNetworkLayer factory(&no_proxy);
+ net::ProxyService proxy_service(new net::ProxyResolverNull);
+ net::HttpNetworkLayer factory(&proxy_service);
TestCompletionCallback callback;