diff options
author | sclittle <sclittle@chromium.org> | 2014-10-15 19:01:31 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-16 02:01:59 +0000 |
commit | 3919c2090e2125ae7219d428e7bd2700c5b4b21f (patch) | |
tree | 42f341052ecd230d67a724c12d6e576a4bc28778 | |
parent | 5dc7274c4f33b0609cfe0162492038a649fcb899 (diff) | |
download | chromium_src-3919c2090e2125ae7219d428e7bd2700c5b4b21f.zip chromium_src-3919c2090e2125ae7219d428e7bd2700c5b4b21f.tar.gz chromium_src-3919c2090e2125ae7219d428e7bd2700c5b4b21f.tar.bz2 |
Fix telemetry tests that run against the data reduction dev proxy.
Currently, the data reduction proxy telemetry tests expect that the dev
proxy string will include the scheme of the URL, but it actually
doesn't. This CL changes the tests to not expect the scheme in the dev
proxy URL.
BUG=423916
Review URL: https://codereview.chromium.org/661613003
Cr-Commit-Position: refs/heads/master@{#299817}
-rw-r--r-- | tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py index 6e2325b..6573598 100644 --- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py @@ -20,7 +20,7 @@ CHROME_PROXY_VIA_HEADER_DEPRECATED = '1.1 Chrome Compression Proxy' 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_DEV_SETTING_HTTP = 'proxy-dev.googlezip.net:80' PROXY_SETTING_HTTP = 'compress.googlezip.net:80' PROXY_SETTING_DIRECT = 'direct://' @@ -98,7 +98,7 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): self.compute_data_saving = True self.effective_proxies = { "proxy": PROXY_SETTING_HTTPS_WITH_SCHEME, - "proxy-dev": PROXY_DEV_SETTING_HTTPS_WITH_SCHEME, + "proxy-dev": PROXY_DEV_SETTING_HTTP, "fallback": PROXY_SETTING_HTTP, "direct": PROXY_SETTING_DIRECT, } @@ -352,14 +352,19 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): 'Safebrowsing failed (count=%d, safebrowsing_count=%d)\n' % ( count, safebrowsing_count)) + def ProxyListForDev(self, proxies): + return [self.effective_proxies['proxy-dev'] + if proxy == self.effective_proxies['proxy'] + else proxy for proxy in proxies] + def VerifyProxyInfo(self, tab, expected_proxies, expected_bad_proxies): info = GetProxyInfoFromNetworkInternals(tab) if not 'enabled' in info or not info['enabled']: raise ChromeProxyMetricException, ( 'Chrome proxy should be enabled. proxy info: %s' % info) - proxies = info['proxies'] - if proxies != expected_proxies: + if (proxies != expected_proxies and + proxies != self.ProxyListForDev(expected_proxies)): raise ChromeProxyMetricException, ( 'Wrong effective proxies (%s). Expect: "%s"' % ( str(proxies), str(expected_proxies))) @@ -368,7 +373,8 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): if 'badProxies' in info and info['badProxies']: bad_proxies = [p['proxy'] for p in info['badProxies'] if 'proxy' in p and p['proxy']] - if bad_proxies != expected_bad_proxies: + if (bad_proxies != expected_bad_proxies and + bad_proxies != self.ProxyListForDev(expected_bad_proxies)): raise ChromeProxyMetricException, ( 'Wrong bad proxies (%s). Expect: "%s"' % ( str(bad_proxies), str(expected_bad_proxies))) |