| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 it != bypass_rules.rules().end(); ++it) { | 42 it != bypass_rules.rules().end(); ++it) { |
| 43 if (!flattened_proxy_bypass.empty()) | 43 if (!flattened_proxy_bypass.empty()) |
| 44 flattened_proxy_bypass += ","; | 44 flattened_proxy_bypass += ","; |
| 45 flattened_proxy_bypass += (*it)->ToString(); | 45 flattened_proxy_bypass += (*it)->ToString(); |
| 46 } | 46 } |
| 47 return flattened_proxy_bypass; | 47 return flattened_proxy_bypass; |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 ProxyRulesExpectation::ProxyRulesExpectation( |
| 53 ProxyConfig::ProxyRules::Type type, |
| 54 const char* single_proxy, |
| 55 const char* proxy_for_http, |
| 56 const char* proxy_for_https, |
| 57 const char* proxy_for_ftp, |
| 58 const char* fallback_proxy, |
| 59 const char* flattened_bypass_rules, |
| 60 bool reverse_bypass) |
| 61 : type(type), |
| 62 single_proxy(single_proxy), |
| 63 proxy_for_http(proxy_for_http), |
| 64 proxy_for_https(proxy_for_https), |
| 65 proxy_for_ftp(proxy_for_ftp), |
| 66 fallback_proxy(fallback_proxy), |
| 67 flattened_bypass_rules(flattened_bypass_rules), |
| 68 reverse_bypass(reverse_bypass) { |
| 69 } |
| 70 |
| 71 |
| 52 ::testing::AssertionResult ProxyRulesExpectation::Matches( | 72 ::testing::AssertionResult ProxyRulesExpectation::Matches( |
| 53 const ProxyConfig::ProxyRules& rules) const { | 73 const ProxyConfig::ProxyRules& rules) const { |
| 54 ::testing::AssertionResult failure_details = ::testing::AssertionFailure(); | 74 ::testing::AssertionResult failure_details = ::testing::AssertionFailure(); |
| 55 bool failed = false; | 75 bool failed = false; |
| 56 | 76 |
| 57 if (rules.type != type) { | 77 if (rules.type != type) { |
| 58 failure_details << "Type mismatch. Expected: " | 78 failure_details << "Type mismatch. Expected: " |
| 59 << type << " but was: " << rules.type; | 79 << type << " but was: " << rules.type; |
| 60 failed = true; | 80 failed = true; |
| 61 } | 81 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 const char* proxy_http, | 157 const char* proxy_http, |
| 138 const char* proxy_https, | 158 const char* proxy_https, |
| 139 const char* proxy_ftp, | 159 const char* proxy_ftp, |
| 140 const char* flattened_bypass_rules) { | 160 const char* flattened_bypass_rules) { |
| 141 return ProxyRulesExpectation(ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME, | 161 return ProxyRulesExpectation(ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME, |
| 142 "", proxy_http, proxy_https, proxy_ftp, "", | 162 "", proxy_http, proxy_https, proxy_ftp, "", |
| 143 flattened_bypass_rules, true); | 163 flattened_bypass_rules, true); |
| 144 } | 164 } |
| 145 | 165 |
| 146 } // namespace net | 166 } // namespace net |
| OLD | NEW |