Chromium Code Reviews| 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 793acebbaffca3671462151cea88d3c37c4d9f68..11fbfafec314b251ef5141f360e014f460fdfedb 100644 |
| --- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py |
| +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py |
| @@ -261,10 +261,16 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): |
| results.current_page, 'lo_fi_response', 'count', lo_fi_response_count)) |
| super(ChromeProxyMetric, self).AddResults(tab, results) |
| - def AddResultsForBypass(self, tab, results): |
| + def AddResultsForBypass(self, tab, results, url_pattern=""): |
| bypass_count = 0 |
| + skipped_count = 0 |
| for resp in self.IterResponses(tab): |
| + # Only check the url's that contain the specified pattern |
|
sclittle
2015/05/19 22:17:45
nit: add period at end of comment
bustamante
2015/05/19 22:26:08
Done.
|
| + if url_pattern and url_pattern not in resp.response.url: |
| + skipped_count += 1 |
| + continue |
| + |
| if resp.HasChromeProxyViaHeader(): |
| r = resp.response |
| raise ChromeProxyMetricException, ( |
| @@ -276,8 +282,11 @@ class ChromeProxyMetric(network_metrics.NetworkMetric): |
| raise ChromeProxyMetricException, ( |
| 'Expected at least one response to be bypassed, but zero such ' |
| 'responses were received.') |
| + |
| results.AddValue(scalar.ScalarValue( |
| results.current_page, 'bypass', 'count', bypass_count)) |
| + results.AddValue(scalar.ScalarValue( |
| + results.current_page, 'skipped', 'count', skipped_count)) |
| def AddResultsForCorsBypass(self, tab, results): |
| eligible_response_count = 0 |