diff options
author | robertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 15:07:50 +0000 |
---|---|---|
committer | robertshield@google.com <robertshield@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 15:07:50 +0000 |
commit | ab501a6a67596eb43d233f91f7500779dcbe8740 (patch) | |
tree | 90bfc9f94bf80c4ed7081d8d54454f02075c3c26 /net/proxy/proxy_config_unittest.cc | |
parent | 481fe3bfb2359849d1d3fc9d0ceba4161fbb5a3e (diff) | |
download | chromium_src-ab501a6a67596eb43d233f91f7500779dcbe8740.zip chromium_src-ab501a6a67596eb43d233f91f7500779dcbe8740.tar.gz chromium_src-ab501a6a67596eb43d233f91f7500779dcbe8740.tar.bz2 |
Making command-line specified proxy settings more flexible - allowing for setting of auto-detect, pac url, per-schema proxy settings, proxy bypass urls.
BUG=http://crbug.com/266
Review URL: http://codereview.chromium.org/115029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_config_unittest.cc')
-rw-r--r-- | net/proxy/proxy_config_unittest.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net/proxy/proxy_config_unittest.cc b/net/proxy/proxy_config_unittest.cc index 9e50e3b..a4192df 100644 --- a/net/proxy/proxy_config_unittest.cc +++ b/net/proxy/proxy_config_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "net/proxy/proxy_config.h" +#include "net/proxy/proxy_config_service_common_unittest.h" #include "testing/gtest/include/gtest/gtest.h" namespace { @@ -197,3 +198,36 @@ TEST(ProxyConfigTest, ParseProxyRules) { config.proxy_rules.proxy_for_ftp); } } + +TEST(ProxyConfigTest, ParseProxyBypassList) { + struct bypass_test { + const char* proxy_bypass_input; + const char* flattened_output; + }; + + const struct { + const char* proxy_bypass_input; + const char* flattened_output; + } tests[] = { + { + "*", + "*\n" + }, + { + ".google.com, .foo.com:42", + "*.google.com\n*.foo.com:42\n" + }, + { + ".google.com, foo.com:99, 1.2.3.4:22, 127.0.0.1/8", + "*.google.com\n*foo.com:99\n1.2.3.4:22\n127.0.0.1/8\n" + } + }; + + net::ProxyConfig config; + + for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { + config.ParseNoProxyList(tests[i].proxy_bypass_input); + EXPECT_EQ(tests[i].flattened_output, + net::FlattenProxyBypass(config.proxy_bypass)); + } +} |