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

Unified Diff: net/proxy/proxy_config_service_common_unittest.cc

Issue 12315019: Change ProxyRules to handle ProxyLists rather than just single ProxyServer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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_common_unittest.cc
diff --git a/net/proxy/proxy_config_service_common_unittest.cc b/net/proxy/proxy_config_service_common_unittest.cc
index 429abc560b86bed3ee1862b1124574c640c18a79..e3d2a57231b5b6ec6f40d9511ac8fb0f8cf1a1bd 100644
--- a/net/proxy/proxy_config_service_common_unittest.cc
+++ b/net/proxy/proxy_config_service_common_unittest.cc
@@ -20,9 +20,15 @@ namespace {
// a description of the failure.
void MatchesProxyServerHelper(const char* failure_message,
const char* expected_proxy,
- const ProxyServer& actual_proxy,
+ const ProxyList& actual_proxies,
::testing::AssertionResult* failure_details,
bool* did_fail) {
+ if (actual_proxies.size() != 1) {
+ *did_fail = true;
+ return;
+ }
+
+ ProxyServer actual_proxy = actual_proxies.Get();
std::string actual_proxy_string;
if (actual_proxy.is_valid())
actual_proxy_string = actual_proxy.ToURI();
@@ -81,13 +87,13 @@ ProxyRulesExpectation::ProxyRulesExpectation(
}
MatchesProxyServerHelper("Bad single_proxy", single_proxy,
- rules.single_proxy, &failure_details, &failed);
+ rules.single_proxies, &failure_details, &failed);
MatchesProxyServerHelper("Bad proxy_for_http", proxy_for_http,
- rules.proxy_for_http, &failure_details, &failed);
+ rules.proxies_for_http, &failure_details,
+ &failed);
MatchesProxyServerHelper("Bad proxy_for_https", proxy_for_https,
- rules.proxy_for_https, &failure_details, &failed);
- MatchesProxyServerHelper("Bad fallback_proxy", fallback_proxy,
- rules.fallback_proxy, &failure_details, &failed);
+ rules.proxies_for_https, &failure_details,
+ &failed);
std::string actual_flattened_bypass = FlattenProxyBypass(rules.bypass_rules);
if (std::string(flattened_bypass_rules) != actual_flattened_bypass) {

Powered by Google App Engine
This is Rietveld 408576698