| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import base64 | 5 import base64 |
| 6 import logging | 6 import logging |
| 7 import urlparse | 7 import urlparse |
| 8 | 8 |
| 9 from integration_tests import chrome_proxy_metrics as metrics | 9 from integration_tests import chrome_proxy_metrics as metrics |
| 10 from metrics import loading | 10 from metrics import loading |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 return True | 86 return True |
| 87 return False | 87 return False |
| 88 | 88 |
| 89 def RunNavigateSteps(self, page, tab): | 89 def RunNavigateSteps(self, page, tab): |
| 90 # The redirect from safebrowsing causes a timeout. Ignore that. | 90 # The redirect from safebrowsing causes a timeout. Ignore that. |
| 91 try: | 91 try: |
| 92 super(ChromeProxyValidation, self).RunNavigateSteps(page, tab) | 92 super(ChromeProxyValidation, self).RunNavigateSteps(page, tab) |
| 93 if self._expect_timeout: | 93 if self._expect_timeout: |
| 94 raise metrics.ChromeProxyMetricException, ( | 94 raise metrics.ChromeProxyMetricException, ( |
| 95 'Timeout was expected, but did not occur') | 95 'Timeout was expected, but did not occur') |
| 96 except exceptions.DevtoolsTargetCrashException, e: | 96 except exceptions.TimeoutException as e: |
| 97 if self._expect_timeout: | 97 if self._expect_timeout: |
| 98 logging.warning('Navigation timeout on page %s', | 98 logging.warning('Navigation timeout on page %s', |
| 99 page.name if page.name else page.url) | 99 page.name if page.name else page.url) |
| 100 else: | 100 else: |
| 101 raise e | 101 raise e |
| 102 | 102 |
| 103 | 103 |
| 104 class ChromeProxyHeaders(ChromeProxyValidation): | 104 class ChromeProxyHeaders(ChromeProxyValidation): |
| 105 """Correctness measurement for response headers.""" | 105 """Correctness measurement for response headers.""" |
| 106 | 106 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 self._metrics.AddResultsForDataSaving, | 378 self._metrics.AddResultsForDataSaving, |
| 379 ], | 379 ], |
| 380 'bypass': [self._metrics.AddResultsForBypass], | 380 'bypass': [self._metrics.AddResultsForBypass], |
| 381 } | 381 } |
| 382 if not self._page.name in page_to_metrics: | 382 if not self._page.name in page_to_metrics: |
| 383 raise page_test.MeasurementFailure( | 383 raise page_test.MeasurementFailure( |
| 384 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 384 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
| 385 self._page.name, page_to_metrics.keys())) | 385 self._page.name, page_to_metrics.keys())) |
| 386 for add_result in page_to_metrics[self._page.name]: | 386 for add_result in page_to_metrics[self._page.name]: |
| 387 add_result(tab, results) | 387 add_result(tab, results) |
| OLD | NEW |