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

Unified Diff: tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py

Issue 661613003: Fix telemetry tests that run against the data reduction dev proxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6e2325b9871aa05e48022c86c1dfd4f9e0d927af..6573598538216a4855215422ceb59e8d93135dcc 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)))
« 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