| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 class ChromeProxyBypass(ChromeProxyValidation): | 105 class ChromeProxyBypass(ChromeProxyValidation): |
| 106 """Correctness measurement for bypass responses.""" | 106 """Correctness measurement for bypass responses.""" |
| 107 | 107 |
| 108 def __init__(self): | 108 def __init__(self): |
| 109 super(ChromeProxyBypass, self).__init__(restart_after_each_page=True) | 109 super(ChromeProxyBypass, self).__init__(restart_after_each_page=True) |
| 110 | 110 |
| 111 def AddResults(self, tab, results): | 111 def AddResults(self, tab, results): |
| 112 self._metrics.AddResultsForBypass(tab, results) | 112 self._metrics.AddResultsForBypass(tab, results) |
| 113 | 113 |
| 114 | 114 |
| 115 class ChromeProxyBlockSingle(ChromeProxyValidation): |
| 116 """Correctness measurement for block_single responses.""" |
| 117 |
| 118 def __init__(self): |
| 119 super(ChromeProxyBlockSingle, self).__init__(restart_after_each_page=True) |
| 120 |
| 121 def AddResults(self, tab, results): |
| 122 self._metrics.AddResultsForBlockSingle(tab, results) |
| 123 |
| 124 |
| 115 class ChromeProxySafebrowsing(ChromeProxyValidation): | 125 class ChromeProxySafebrowsing(ChromeProxyValidation): |
| 116 """Correctness measurement for safebrowsing.""" | 126 """Correctness measurement for safebrowsing.""" |
| 117 | 127 |
| 118 def __init__(self): | 128 def __init__(self): |
| 119 super(ChromeProxySafebrowsing, self).__init__() | 129 super(ChromeProxySafebrowsing, self).__init__() |
| 120 | 130 |
| 121 def WillNavigateToPage(self, page, tab): | 131 def WillNavigateToPage(self, page, tab): |
| 122 super(ChromeProxySafebrowsing, self).WillNavigateToPage(page, tab) | 132 super(ChromeProxySafebrowsing, self).WillNavigateToPage(page, tab) |
| 123 self._expect_timeout = True | 133 self._expect_timeout = True |
| 124 | 134 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 ], | 252 ], |
| 243 'bypass': [self._metrics.AddResultsForBypass], | 253 'bypass': [self._metrics.AddResultsForBypass], |
| 244 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], | 254 'safebrowsing': [self._metrics.AddResultsForSafebrowsing], |
| 245 } | 255 } |
| 246 if not self._page.name in page_to_metrics: | 256 if not self._page.name in page_to_metrics: |
| 247 raise page_test.MeasurementFailure( | 257 raise page_test.MeasurementFailure( |
| 248 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 258 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
| 249 self._page.name, page_to_metrics.keys())) | 259 self._page.name, page_to_metrics.keys())) |
| 250 for add_result in page_to_metrics[self._page.name]: | 260 for add_result in page_to_metrics[self._page.name]: |
| 251 add_result(tab, results) | 261 add_result(tab, results) |
| OLD | NEW |