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

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

Issue 744703003: Reduce DRP telemetry tests' dependence on net-internals#proxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py ('k') | 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 b9be2832dfa7d7bfcfa5039b1ae941cae106b657..7a070f46a02d0f6339b93435832015513af04c24 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -353,7 +353,6 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
r.url, r.GetHeader('Via'), r.GetHeader('Referer'), r.status))
bypass_count += 1
- self.VerifyAllProxiesBypassed(tab)
bolian 2014/12/09 22:06:14 Not verifying this any more?
sclittle 2014/12/09 22:25:21 Not anymore. The only thing this call gains us her
results.AddValue(scalar.ScalarValue(
results.current_page, 'bypass', 'count', bypass_count))
@@ -404,13 +403,6 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
if not resp.HasChromeProxyViaHeader():
bypass_count += 1
- if tab:
- info = GetProxyInfoFromNetworkInternals(tab)
- if not info['enabled']:
- raise ChromeProxyMetricException, (
- 'Chrome proxy should be enabled. proxy info: %s' % info)
- self.VerifyBadProxies(info['badProxies'], [])
-
if eligible_response_count <= 1:
raise ChromeProxyMetricException, (
'There should be more than one DRP eligible response '
@@ -479,14 +471,27 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
if not expected_bad_proxies:
expected_bad_proxies = []
+ # TODO(sclittle): Remove this dependency on net-internals#proxy once an
+ # alternative method of verifying that Chrome is on the fallback proxy
+ # exists.
self.VerifyProxyInfo(tab, expected_proxies, expected_bad_proxies)
results.AddValue(scalar.ScalarValue(
results.current_page, 'http_fallback', 'boolean', True))
def AddResultsForHTTPToDirectFallback(self, tab, results):
- self.VerifyAllProxiesBypassed(tab)
+ bypass_count = 0
+ for resp in self.IterResponses(tab):
+ if resp.HasChromeProxyViaHeader():
+ r = resp.response
+ raise ChromeProxyMetricException, (
+ 'Response for %s should not have via header. '
+ 'Reponse: status=(%d, %s)\nHeaders:\n %s' % (
+ r.url, r.status, r.status_text, r.headers))
+ else:
+ bypass_count += 1
+
results.AddValue(scalar.ScalarValue(
- results.current_page, 'direct_fallback', 'boolean', True))
+ results.current_page, 'bypass', 'count', bypass_count))
bolian 2014/12/09 22:06:14 This result, 'bypass', does not match the func nam
sclittle 2014/12/09 22:25:21 Should it match it? This result is the number of b
def AddResultsForExplicitBypass(self, tab, results, expected_bad_proxies):
"""Verify results for an explicit bypass test.
@@ -502,6 +507,9 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
if not 'enabled' in info or not info['enabled']:
raise ChromeProxyMetricException, (
'Chrome proxy should be enabled. proxy info: %s' % info)
+ # TODO(sclittle): Remove this dependency on net-internals#proxy once an
+ # alternative method of verifying that Chrome is on the fallback proxy
+ # exists.
self.VerifyBadProxies(info['badProxies'],
expected_bad_proxies)
results.AddValue(scalar.ScalarValue(
« no previous file with comments | « tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698