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

Side by Side Diff: tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py

Issue 664483004: Make IsProxyBypassed work when there are no bad proxies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 import datetime 5 import datetime
6 import logging 6 import logging
7 import os 7 import os
8 8
9 from integration_tests import network_metrics 9 from integration_tests import network_metrics
10 from telemetry.page import page_test 10 from telemetry.page import page_test
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 Otherwise, the return value will be (False, empty list). 184 Otherwise, the return value will be (False, empty list).
185 """ 185 """
186 if not tab: 186 if not tab:
187 return False, [] 187 return False, []
188 188
189 info = GetProxyInfoFromNetworkInternals(tab) 189 info = GetProxyInfoFromNetworkInternals(tab)
190 if not info['enabled']: 190 if not info['enabled']:
191 raise ChromeProxyMetricException, ( 191 raise ChromeProxyMetricException, (
192 'Chrome proxy should be enabled. proxy info: %s' % info) 192 'Chrome proxy should be enabled. proxy info: %s' % info)
193 193
194 if not info['badProxies']:
195 return False, []
196
194 bad_proxies = [str(p['proxy']) for p in info['badProxies']] 197 bad_proxies = [str(p['proxy']) for p in info['badProxies']]
195 bad_proxies.sort() 198 bad_proxies.sort()
196 proxies = [self.effective_proxies['proxy'], 199 proxies = [self.effective_proxies['proxy'],
197 self.effective_proxies['fallback']] 200 self.effective_proxies['fallback']]
198 proxies.sort() 201 proxies.sort()
199 proxies_dev = self.ProxyListForDev(proxies) 202 proxies_dev = self.ProxyListForDev(proxies)
200 proxies_dev.sort() 203 proxies_dev.sort()
201 if bad_proxies == proxies: 204 if bad_proxies == proxies:
202 return True, proxies 205 return True, proxies
203 elif bad_proxies == proxies_dev: 206 elif bad_proxies == proxies_dev:
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 See the definition of VerifyBadProxies for details. 451 See the definition of VerifyBadProxies for details.
449 """ 452 """
450 info = GetProxyInfoFromNetworkInternals(tab) 453 info = GetProxyInfoFromNetworkInternals(tab)
451 if not 'enabled' in info or not info['enabled']: 454 if not 'enabled' in info or not info['enabled']:
452 raise ChromeProxyMetricException, ( 455 raise ChromeProxyMetricException, (
453 'Chrome proxy should be enabled. proxy info: %s' % info) 456 'Chrome proxy should be enabled. proxy info: %s' % info)
454 self.VerifyBadProxies(info['badProxies'], 457 self.VerifyBadProxies(info['badProxies'],
455 expected_bad_proxies) 458 expected_bad_proxies)
456 results.AddValue(scalar.ScalarValue( 459 results.AddValue(scalar.ScalarValue(
457 results.current_page, 'explicit_bypass', 'boolean', True)) 460 results.current_page, 'explicit_bypass', 'boolean', True))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698