Commit b904b15f authored by sclittle's avatar sclittle Committed by Commit bot

Make IsProxyBypassed work when there are no bad proxies.

Currently, if there are no bad proxies, IsProxyBypassed will cause a
runtime error. This change makes it return (False, []) as expected.

BUG=427666

Review URL: https://codereview.chromium.org/664483004

Cr-Commit-Position: refs/heads/master@{#301470}
parent ad3bfefc
...@@ -191,6 +191,9 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): ...@@ -191,6 +191,9 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
raise ChromeProxyMetricException, ( raise ChromeProxyMetricException, (
'Chrome proxy should be enabled. proxy info: %s' % info) 'Chrome proxy should be enabled. proxy info: %s' % info)
if not info['badProxies']:
return False, []
bad_proxies = [str(p['proxy']) for p in info['badProxies']] bad_proxies = [str(p['proxy']) for p in info['badProxies']]
bad_proxies.sort() bad_proxies.sort()
proxies = [self.effective_proxies['proxy'], proxies = [self.effective_proxies['proxy'],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment