| Index: tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
|
| diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
|
| index 92ddce4e894f37e58e3469a421eb0661ec79ae06..fd26a2d9254a03c22d7cf11930cfb4ed033b995f 100644
|
| --- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
|
| +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
|
| @@ -20,7 +20,6 @@
|
|
|
| PROXY_SETTING_HTTPS = 'proxy.googlezip.net:443'
|
| PROXY_SETTING_HTTPS_WITH_SCHEME = 'https://' + PROXY_SETTING_HTTPS
|
| -PROXY_DEV_SETTING_HTTPS_WITH_SCHEME = 'http://proxy-dev.googlezip.net:80'
|
| PROXY_SETTING_HTTP = 'compress.googlezip.net:80'
|
| PROXY_SETTING_DIRECT = 'direct://'
|
|
|
| @@ -98,7 +97,6 @@
|
| self.compute_data_saving = True
|
| self.effective_proxies = {
|
| "proxy": PROXY_SETTING_HTTPS_WITH_SCHEME,
|
| - "proxy-dev": PROXY_DEV_SETTING_HTTPS_WITH_SCHEME,
|
| "fallback": PROXY_SETTING_HTTP,
|
| "direct": PROXY_SETTING_DIRECT,
|
| }
|
| @@ -142,16 +140,14 @@
|
| for resp in self.IterResponses(tab):
|
| if resp.IsValidByViaHeader():
|
| via_count += 1
|
| + elif tab and self.IsProxyBypassed(tab):
|
| + logging.warning('Proxy bypassed for %s', resp.response.url)
|
| + bypass_count += 1
|
| else:
|
| - bypassed, _ = self.IsProxyBypassed(tab)
|
| - if tab and bypassed:
|
| - logging.warning('Proxy bypassed for %s', resp.response.url)
|
| - bypass_count += 1
|
| - else:
|
| - r = resp.response
|
| - raise ChromeProxyMetricException, (
|
| - '%s: Via header (%s) is not valid (refer=%s, status=%d)' % (
|
| - r.url, r.GetHeader('Via'), r.GetHeader('Referer'), r.status))
|
| + r = resp.response
|
| + raise ChromeProxyMetricException, (
|
| + '%s: Via header (%s) is not valid (refer=%s, status=%d)' % (
|
| + r.url, r.GetHeader('Via'), r.GetHeader('Referer'), r.status))
|
| results.AddValue(scalar.ScalarValue(
|
| results.current_page, 'checked_via_header', 'count', via_count))
|
| results.AddValue(scalar.ScalarValue(
|
| @@ -164,19 +160,10 @@
|
| raise ChromeProxyMetricException, (
|
| 'Chrome proxy should be enabled. proxy info: %s' % info)
|
|
|
| - bad_proxies = [str(p['proxy']) for p in info['badProxies']]
|
| - bad_proxies.sort()
|
| + bad_proxies = [str(p['proxy']) for p in info['badProxies']].sort()
|
| proxies = [self.effective_proxies['proxy'],
|
| - self.effective_proxies['fallback']]
|
| - proxies.sort()
|
| - proxies_dev = [self.effective_proxies['proxy-dev'],
|
| - self.effective_proxies['fallback']]
|
| - proxies_dev.sort()
|
| - if bad_proxies == proxies:
|
| - return True, proxies
|
| - elif bad_proxies == proxies_dev:
|
| - return True, proxies_dev
|
| - return False, []
|
| + self.effective_proxies['fallback']].sort()
|
| + return bad_proxies == proxies
|
|
|
| @staticmethod
|
| def VerifyBadProxies(
|
| @@ -226,8 +213,10 @@
|
| if not info['enabled']:
|
| raise ChromeProxyMetricException, (
|
| 'Chrome proxy should be enabled. proxy info: %s' % info)
|
| - _, expected_bad_proxies = self.IsProxyBypassed(tab)
|
| - self.VerifyBadProxies(info['badProxies'], expected_bad_proxies)
|
| + self.VerifyBadProxies(
|
| + info['badProxies'],
|
| + [self.effective_proxies['proxy'],
|
| + self.effective_proxies['fallback']])
|
|
|
| results.AddValue(scalar.ScalarValue(
|
| results.current_page, 'bypass', 'count', bypass_count))
|
|
|