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

Unified Diff: net/proxy/proxy_config_service_win_unittest.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/proxy/proxy_config_service_win_unittest.cc
diff --git a/net/proxy/proxy_config_service_win_unittest.cc b/net/proxy/proxy_config_service_win_unittest.cc
index 911949d59944a753733875e48753a4327108e393..a8c0921ede9456133b5776de46016a2de54d5522 100644
--- a/net/proxy/proxy_config_service_win_unittest.cc
+++ b/net/proxy/proxy_config_service_win_unittest.cc
@@ -22,172 +22,170 @@ TEST(ProxyConfigServiceWinTest, SetFromIEConfig) {
ProxyRulesExpectation proxy_rules;
const char* proxy_bypass_list; // newline separated
} tests[] = {
- // Auto detect.
- {
- { // Input.
- TRUE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- NULL, // lpszProxy
- NULL, // lpszProxyBypass
- },
-
- // Expected result.
- true, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::Empty(),
- },
-
- // Valid PAC url
- {
- { // Input.
- FALSE, // fAutoDetect
- L"http://wpad/wpad.dat", // lpszAutoConfigUrl
- NULL, // lpszProxy
- NULL, // lpszProxy_bypass
- },
-
- // Expected result.
- false, // auto_detect
- GURL("http://wpad/wpad.dat"), // pac_url
- ProxyRulesExpectation::Empty(),
- },
-
- // Invalid PAC url string.
- {
- { // Input.
- FALSE, // fAutoDetect
- L"wpad.dat", // lpszAutoConfigUrl
- NULL, // lpszProxy
- NULL, // lpszProxy_bypass
- },
-
- // Expected result.
- false, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::Empty(),
- },
-
- // Single-host in proxy list.
- {
- { // Input.
- FALSE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- L"www.google.com", // lpszProxy
- NULL, // lpszProxy_bypass
- },
-
- // Expected result.
- false, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::Single(
- "www.google.com:80", // single proxy
- ""), // bypass rules
- },
-
- // Per-scheme proxy rules.
- {
- { // Input.
- FALSE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- L"http=www.google.com:80;https=www.foo.com:110", // lpszProxy
- NULL, // lpszProxy_bypass
- },
-
- // Expected result.
- false, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::PerScheme(
- "www.google.com:80", // http
- "www.foo.com:110", // https
- "", // ftp
- ""), // bypass rules
- },
-
- // SOCKS proxy configuration.
- {
- { // Input.
- FALSE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- L"http=www.google.com:80;https=www.foo.com:110;"
- L"ftp=ftpproxy:20;socks=foopy:130", // lpszProxy
- NULL, // lpszProxy_bypass
- },
-
- // Expected result.
- // Note that "socks" is interprted as meaning "socks4", since that is how
- // Internet Explorer applies the settings. For more details on this
- // policy, see:
- // http://code.google.com/p/chromium/issues/detail?id=55912#c2
- false, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::PerSchemeWithSocks(
- "www.google.com:80", // http
- "www.foo.com:110", // https
- "ftpproxy:20", // ftp
- "socks4://foopy:130", // socks
- ""), // bypass rules
- },
-
- // Bypass local names.
- {
- { // Input.
- TRUE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- NULL, // lpszProxy
- L"<local>", // lpszProxy_bypass
- },
-
- true, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::EmptyWithBypass("<local>"),
- },
-
- // Bypass "google.com" and local names, using semicolon as delimiter
- // (ignoring white space).
- {
- { // Input.
- TRUE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- NULL, // lpszProxy
- L"<local> ; google.com", // lpszProxy_bypass
- },
-
- // Expected result.
- true, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::EmptyWithBypass("<local>,google.com"),
- },
-
- // Bypass "foo.com" and "google.com", using lines as delimiter.
- {
- { // Input.
- TRUE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- NULL, // lpszProxy
- L"foo.com\r\ngoogle.com", // lpszProxy_bypass
- },
-
- // Expected result.
- true, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::EmptyWithBypass("foo.com,google.com"),
- },
-
- // Bypass "foo.com" and "google.com", using commas as delimiter.
- {
- { // Input.
- TRUE, // fAutoDetect
- NULL, // lpszAutoConfigUrl
- NULL, // lpszProxy
- L"foo.com, google.com", // lpszProxy_bypass
- },
-
- // Expected result.
- true, // auto_detect
- GURL(), // pac_url
- ProxyRulesExpectation::EmptyWithBypass("foo.com,google.com"),
- },
- };
+ // Auto detect.
+ {
+ { // Input.
+ TRUE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ NULL, // lpszProxy
+ NULL, // lpszProxyBypass
+ },
+
+ // Expected result.
+ true, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::Empty(),
+ },
+
+ // Valid PAC url
+ {
+ { // Input.
+ FALSE, // fAutoDetect
+ L"http://wpad/wpad.dat", // lpszAutoConfigUrl
+ NULL, // lpszProxy
+ NULL, // lpszProxy_bypass
+ },
+
+ // Expected result.
+ false, // auto_detect
+ GURL("http://wpad/wpad.dat"), // pac_url
+ ProxyRulesExpectation::Empty(),
+ },
+
+ // Invalid PAC url string.
+ {
+ { // Input.
+ FALSE, // fAutoDetect
+ L"wpad.dat", // lpszAutoConfigUrl
+ NULL, // lpszProxy
+ NULL, // lpszProxy_bypass
+ },
+
+ // Expected result.
+ false, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::Empty(),
+ },
+
+ // Single-host in proxy list.
+ {
+ { // Input.
+ FALSE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ L"www.google.com", // lpszProxy
+ NULL, // lpszProxy_bypass
+ },
+
+ // Expected result.
+ false, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::Single("www.google.com:80", // single proxy
+ ""), // bypass rules
+ },
+
+ // Per-scheme proxy rules.
+ {
+ { // Input.
+ FALSE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ L"http=www.google.com:80;https=www.foo.com:110", // lpszProxy
+ NULL, // lpszProxy_bypass
+ },
+
+ // Expected result.
+ false, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::PerScheme("www.google.com:80", // http
+ "www.foo.com:110", // https
+ "", // ftp
+ ""), // bypass rules
+ },
+
+ // SOCKS proxy configuration.
+ {
+ { // Input.
+ FALSE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ L"http=www.google.com:80;https=www.foo.com:110;"
+ L"ftp=ftpproxy:20;socks=foopy:130", // lpszProxy
+ NULL, // lpszProxy_bypass
+ },
+
+ // Expected result.
+ // Note that "socks" is interprted as meaning "socks4", since that is
+ // how
+ // Internet Explorer applies the settings. For more details on this
+ // policy, see:
+ // http://code.google.com/p/chromium/issues/detail?id=55912#c2
+ false, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::PerSchemeWithSocks(
+ "www.google.com:80", // http
+ "www.foo.com:110", // https
+ "ftpproxy:20", // ftp
+ "socks4://foopy:130", // socks
+ ""), // bypass rules
+ },
+
+ // Bypass local names.
+ {
+ { // Input.
+ TRUE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ NULL, // lpszProxy
+ L"<local>", // lpszProxy_bypass
+ },
+ true, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::EmptyWithBypass("<local>"),
+ },
+
+ // Bypass "google.com" and local names, using semicolon as delimiter
+ // (ignoring white space).
+ {
+ { // Input.
+ TRUE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ NULL, // lpszProxy
+ L"<local> ; google.com", // lpszProxy_bypass
+ },
+
+ // Expected result.
+ true, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::EmptyWithBypass("<local>,google.com"),
+ },
+
+ // Bypass "foo.com" and "google.com", using lines as delimiter.
+ {
+ { // Input.
+ TRUE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ NULL, // lpszProxy
+ L"foo.com\r\ngoogle.com", // lpszProxy_bypass
+ },
+
+ // Expected result.
+ true, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::EmptyWithBypass("foo.com,google.com"),
+ },
+
+ // Bypass "foo.com" and "google.com", using commas as delimiter.
+ {
+ { // Input.
+ TRUE, // fAutoDetect
+ NULL, // lpszAutoConfigUrl
+ NULL, // lpszProxy
+ L"foo.com, google.com", // lpszProxy_bypass
+ },
+
+ // Expected result.
+ true, // auto_detect
+ GURL(), // pac_url
+ ProxyRulesExpectation::EmptyWithBypass("foo.com,google.com"),
+ },
+ };
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
ProxyConfig config;

Powered by Google App Engine
This is Rietveld 408576698