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

Side by Side Diff: net/proxy/proxy_config_service_linux_unittest.cc

Issue 2397873002: Reject some previuosly-escaped chars in hostnames.
Patch Set: Some tests fixed Created 4 years, 1 month 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
« no previous file with comments | « net/http/http_security_headers_unittest.cc ('k') | url/url_canon_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/proxy/proxy_config_service_linux.h" 5 #include "net/proxy/proxy_config_service_linux.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 ProxyConfigService::CONFIG_VALID, 1435 ProxyConfigService::CONFIG_VALID,
1436 false, // auto_detect 1436 false, // auto_detect
1437 GURL(), // pac_url 1437 GURL(), // pac_url
1438 ProxyRulesExpectation::PerScheme("www.google.com:80", // http 1438 ProxyRulesExpectation::PerScheme("www.google.com:80", // http
1439 "", // https 1439 "", // https
1440 "ftp.foo.com:80", // ftp 1440 "ftp.foo.com:80", // ftp
1441 ""), // bypass rules 1441 ""), // bypass rules
1442 }, 1442 },
1443 1443
1444 { 1444 {
1445 TEST_DESC("Handle strange whitespace"),
1446
1447 // Input.
1448 "[Proxy Settings]\nProxyType [$e] =2\n"
1449 " Proxy Config Script = http:// foo\n",
1450 {}, // env_values
1451
1452 // Expected result.
1453 ProxyConfigService::CONFIG_VALID,
1454 false, // auto_detect
1455 GURL("http:// foo"), // pac_url
1456 ProxyRulesExpectation::Empty(),
1457 },
1458
1459 {
1460 TEST_DESC("Ignore all of a line which is too long"), 1445 TEST_DESC("Ignore all of a line which is too long"),
1461 1446
1462 // Input. 1447 // Input.
1463 std::string("[Proxy Settings]\nProxyType=1\nftpProxy=ftp.foo.com\n") + 1448 std::string("[Proxy Settings]\nProxyType=1\nftpProxy=ftp.foo.com\n") +
1464 long_line + "httpsProxy=www.foo.com\nhttpProxy=www.google.com\n", 1449 long_line + "httpsProxy=www.foo.com\nhttpProxy=www.google.com\n",
1465 {}, // env_values 1450 {}, // env_values
1466 1451
1467 // Expected result. 1452 // Expected result.
1468 ProxyConfigService::CONFIG_VALID, 1453 ProxyConfigService::CONFIG_VALID,
1469 false, // auto_detect 1454 false, // auto_detect
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, 1657 EXPECT_EQ(ProxyConfigService::CONFIG_VALID,
1673 sync_config_getter.SyncGetLatestProxyConfig(&config)); 1658 sync_config_getter.SyncGetLatestProxyConfig(&config));
1674 EXPECT_FALSE(config.auto_detect()); 1659 EXPECT_FALSE(config.auto_detect());
1675 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules())); 1660 EXPECT_TRUE(slaverc5_rules.Matches(config.proxy_rules()));
1676 } 1661 }
1677 } 1662 }
1678 1663
1679 } // namespace 1664 } // namespace
1680 1665
1681 } // namespace net 1666 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_security_headers_unittest.cc ('k') | url/url_canon_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698