| 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 9c12daa1c4781d54ce840f90646d562c81ff11c0..af6dbacc03174e41238e92d2519250e1ba99b4fe 100644
|
| --- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
|
| +++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
|
| @@ -872,6 +872,26 @@ class ChromeProxyMetric(network_metrics.NetworkMetric):
|
| results.AddValue(scalar.ScalarValue(
|
| results.current_page, 'succeeded_sum', 'count', succeeded))
|
|
|
| + def AddResultsForBypassOnTimeout(self, tab, results):
|
| + bypass_count = 0
|
| + # It should not take more than 90 seconds to bypass the origin for sake of
|
| + # user experience, keeping in mind poor connections.
|
| + tab.WaitForDocumentReadyStateToBeComplete(timeout=90)
|
| + for resp in self.IterResponses(tab):
|
| + if resp.HasChromeProxyViaHeader() and not resp.response.url.endswith(
|
| + 'favicon.ico'):
|
| + r = resp.response
|
| + raise ChromeProxyMetricException, (
|
| + 'Response for %s should not have via header after HTTP timeout.\n'
|
| + 'Reponse: status=(%d)\nHeaders:\n %s' % (
|
| + r.url, r.status, r.headers))
|
| + elif not resp.response.url.endswith('favicon.ico'):
|
| + bypass_count += 1
|
| + if bypass_count == 0:
|
| + raise ChromeProxyMetricException('No pages were tested!')
|
| + results.AddValue(scalar.ScalarValue(
|
| + results.current_page, 'bypass', 'count', bypass_count))
|
| +
|
| PROXIED = 'proxied'
|
| DIRECT = 'direct'
|
|
|
|
|