Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_common_unittest.h" | 5 #include "net/proxy/proxy_config_service_common_unittest.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "net/proxy/proxy_config.h" | 10 #include "net/proxy/proxy_config.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 ::testing::AssertionResult failure_details = ::testing::AssertionFailure(); | 74 ::testing::AssertionResult failure_details = ::testing::AssertionFailure(); |
| 75 bool failed = false; | 75 bool failed = false; |
| 76 | 76 |
| 77 if (rules.type != type) { | 77 if (rules.type != type) { |
| 78 failure_details << "Type mismatch. Expected: " | 78 failure_details << "Type mismatch. Expected: " |
| 79 << type << " but was: " << rules.type; | 79 << type << " but was: " << rules.type; |
| 80 failed = true; | 80 failed = true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 MatchesProxyServerHelper("Bad single_proxy", single_proxy, | 83 MatchesProxyServerHelper("Bad single_proxy", single_proxy, |
| 84 rules.single_proxy, &failure_details, &failed); | 84 rules.single_proxy.Get(), &failure_details, &failed); |
|
eroman
2013/02/26 01:13:50
It seems it would be appropriate to change the exp
marq_use_my_chromium_address
2013/02/27 23:08:19
Done.
| |
| 85 MatchesProxyServerHelper("Bad proxy_for_http", proxy_for_http, | 85 MatchesProxyServerHelper("Bad proxy_for_http", proxy_for_http, |
| 86 rules.proxy_for_http, &failure_details, &failed); | 86 rules.proxy_for_http.Get(), &failure_details, |
| 87 &failed); | |
| 87 MatchesProxyServerHelper("Bad proxy_for_https", proxy_for_https, | 88 MatchesProxyServerHelper("Bad proxy_for_https", proxy_for_https, |
| 88 rules.proxy_for_https, &failure_details, &failed); | 89 rules.proxy_for_https.Get(), &failure_details, |
| 89 MatchesProxyServerHelper("Bad fallback_proxy", fallback_proxy, | 90 &failed); |
| 90 rules.fallback_proxy, &failure_details, &failed); | |
| 91 | 91 |
| 92 std::string actual_flattened_bypass = FlattenProxyBypass(rules.bypass_rules); | 92 std::string actual_flattened_bypass = FlattenProxyBypass(rules.bypass_rules); |
| 93 if (std::string(flattened_bypass_rules) != actual_flattened_bypass) { | 93 if (std::string(flattened_bypass_rules) != actual_flattened_bypass) { |
| 94 failure_details | 94 failure_details |
| 95 << "Bad bypass rules. Expected: \"" << flattened_bypass_rules | 95 << "Bad bypass rules. Expected: \"" << flattened_bypass_rules |
| 96 << "\" but got: \"" << actual_flattened_bypass << "\""; | 96 << "\" but got: \"" << actual_flattened_bypass << "\""; |
| 97 failed = true; | 97 failed = true; |
| 98 } | 98 } |
| 99 | 99 |
| 100 if (rules.reverse_bypass != reverse_bypass) { | 100 if (rules.reverse_bypass != reverse_bypass) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 const char* proxy_http, | 157 const char* proxy_http, |
| 158 const char* proxy_https, | 158 const char* proxy_https, |
| 159 const char* proxy_ftp, | 159 const char* proxy_ftp, |
| 160 const char* flattened_bypass_rules) { | 160 const char* flattened_bypass_rules) { |
| 161 return ProxyRulesExpectation(ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME, | 161 return ProxyRulesExpectation(ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME, |
| 162 "", proxy_http, proxy_https, proxy_ftp, "", | 162 "", proxy_http, proxy_https, proxy_ftp, "", |
| 163 flattened_bypass_rules, true); | 163 flattened_bypass_rules, true); |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace net | 166 } // namespace net |
| OLD | NEW |