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 common.chrome_proxy_measurements import ChromeProxyValidation | 9 from common.chrome_proxy_measurements import ChromeProxyValidation |
10 from integration_tests import chrome_proxy_metrics as metrics | 10 from integration_tests import chrome_proxy_metrics as metrics |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 self._metrics.AddResultsForBlockOnce(tab, results) | 106 self._metrics.AddResultsForBlockOnce(tab, results) |
107 | 107 |
108 | 108 |
109 class ChromeProxySafebrowsingOn(ChromeProxyValidation): | 109 class ChromeProxySafebrowsingOn(ChromeProxyValidation): |
110 """Correctness measurement for safebrowsing.""" | 110 """Correctness measurement for safebrowsing.""" |
111 | 111 |
112 def __init__(self): | 112 def __init__(self): |
113 super(ChromeProxySafebrowsingOn, self).__init__( | 113 super(ChromeProxySafebrowsingOn, self).__init__( |
114 metrics=metrics.ChromeProxyMetric()) | 114 metrics=metrics.ChromeProxyMetric()) |
115 | 115 |
116 def WillNavigateToPage(self, page, tab): | |
117 super(ChromeProxySafebrowsingOn, self).WillNavigateToPage(page, tab) | |
118 self._expect_timeout = True | |
119 | |
120 def AddResults(self, tab, results): | 116 def AddResults(self, tab, results): |
121 self._metrics.AddResultsForSafebrowsingOn(tab, results) | 117 self._metrics.AddResultsForSafebrowsingOn(tab, results) |
122 | 118 |
123 class ChromeProxySafebrowsingOff(ChromeProxyValidation): | 119 class ChromeProxySafebrowsingOff(ChromeProxyValidation): |
124 """Correctness measurement for safebrowsing.""" | 120 """Correctness measurement for safebrowsing.""" |
125 | 121 |
126 def __init__(self): | 122 def __init__(self): |
127 super(ChromeProxySafebrowsingOff, self).__init__( | 123 super(ChromeProxySafebrowsingOff, self).__init__( |
128 metrics=metrics.ChromeProxyMetric()) | 124 metrics=metrics.ChromeProxyMetric()) |
129 | 125 |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 self._metrics.AddResultsForDataSaving, | 365 self._metrics.AddResultsForDataSaving, |
370 ], | 366 ], |
371 'bypass': [self._metrics.AddResultsForBypass], | 367 'bypass': [self._metrics.AddResultsForBypass], |
372 } | 368 } |
373 if not self._page.name in page_to_metrics: | 369 if not self._page.name in page_to_metrics: |
374 raise page_test.MeasurementFailure( | 370 raise page_test.MeasurementFailure( |
375 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( | 371 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( |
376 self._page.name, page_to_metrics.keys())) | 372 self._page.name, page_to_metrics.keys())) |
377 for add_result in page_to_metrics[self._page.name]: | 373 for add_result in page_to_metrics[self._page.name]: |
378 add_result(tab, results) | 374 add_result(tab, results) |
OLD | NEW |