diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 01:03:23 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-31 01:03:23 +0000 |
commit | 5b45aec04af2be235787c81369c77d627ebd639a (patch) | |
tree | af51655c9ca9374181722a96514f9b827cdceb34 /net/proxy/proxy_service_unittest.cc | |
parent | 6dd6c74b945802513e94b4be1012ccfbe240f023 (diff) | |
download | chromium_src-5b45aec04af2be235787c81369c77d627ebd639a.zip chromium_src-5b45aec04af2be235787c81369c77d627ebd639a.tar.gz chromium_src-5b45aec04af2be235787c81369c77d627ebd639a.tar.bz2 |
Extract the parsing of proxy rules to ProxyConfig::ProxyRules, and unit-test.
This avoids re-parsing the rules every time a proxy resolve is done, and also adds extra tolerance for white space.
The other motivation is to not have to fiddle around with strings as much in the various ProxyConfigServceXXXX implementations.
Review URL: http://codereview.chromium.org/57011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12829 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service_unittest.cc')
-rw-r--r-- | net/proxy/proxy_service_unittest.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc index ba8186f..68d4be5 100644 --- a/net/proxy/proxy_service_unittest.cc +++ b/net/proxy/proxy_service_unittest.cc @@ -687,7 +687,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { // Test what happens when a proxy bypass list is specified. net::ProxyConfig config; - config.proxy_rules = "foopy1:8080;foopy2:9090"; + config.proxy_rules.ParseFromString("foopy1:8080;foopy2:9090"); config.auto_detect = false; config.proxy_bypass_local_names = true; @@ -767,7 +767,7 @@ TEST(ProxyServiceTest, ProxyBypassList) { TEST(ProxyServiceTest, PerProtocolProxyTests) { net::ProxyConfig config; - config.proxy_rules = "http=foopy1:8080;https=foopy2:8080"; + config.proxy_rules.ParseFromString("http=foopy1:8080;https=foopy2:8080"); config.auto_detect = false; SyncProxyService service1(new MockProxyConfigService(config), @@ -797,7 +797,7 @@ TEST(ProxyServiceTest, PerProtocolProxyTests) { EXPECT_FALSE(info3.is_direct()); EXPECT_EQ("foopy2:8080", info3.proxy_server().ToURI()); - config.proxy_rules = "foopy1:8080"; + config.proxy_rules.ParseFromString("foopy1:8080"); SyncProxyService service4(new MockProxyConfigService(config), new MockProxyResolver); GURL test_url4("www.microsoft.com"); |