Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py

Issue 1151753003: Integration test for Chrome-Proxy: pass-through directive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@loFiSnackbar
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 restart_after_each_page=True, 287 restart_after_each_page=True,
288 metrics=metrics.ChromeProxyMetric()) 288 metrics=metrics.ChromeProxyMetric())
289 289
290 def CustomizeBrowserOptions(self, options): 290 def CustomizeBrowserOptions(self, options):
291 super(ChromeProxyExpDirective, self).CustomizeBrowserOptions(options) 291 super(ChromeProxyExpDirective, self).CustomizeBrowserOptions(options)
292 options.AppendExtraBrowserArgs('--data-reduction-proxy-experiment=test') 292 options.AppendExtraBrowserArgs('--data-reduction-proxy-experiment=test')
293 293
294 def AddResults(self, tab, results): 294 def AddResults(self, tab, results):
295 self._metrics.AddResultsForBypass(tab, results) 295 self._metrics.AddResultsForBypass(tab, results)
296 296
297 class ChromeProxyPassThrough(ChromeProxyValidation):
298 """Correctness measurement for Chrome-Proxy pass-through directives.
299
300 This test verifies that "pass-through" in the Chrome-Proxy request header
301 causes a resource to be loaded without Data Reduction Proxy transformations.
302 """
303
304 def __init__(self):
305 super(ChromeProxyPassThrough, self).__init__(
306 restart_after_each_page=True,
307 metrics=metrics.ChromeProxyMetric())
308
309 def CustomizeBrowserOptions(self, options):
310 super(ChromeProxyPassThrough, self).CustomizeBrowserOptions(options)
311
312 def AddResults(self, tab, results):
313 self._metrics.AddResultsForPassThrough(tab, results)
297 314
298 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): 315 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation):
299 """Correctness measurement for HTTP proxy fallback to direct.""" 316 """Correctness measurement for HTTP proxy fallback to direct."""
300 317
301 def __init__(self): 318 def __init__(self):
302 super(ChromeProxyHTTPToDirectFallback, self).__init__( 319 super(ChromeProxyHTTPToDirectFallback, self).__init__(
303 restart_after_each_page=True, 320 restart_after_each_page=True,
304 metrics=metrics.ChromeProxyMetric()) 321 metrics=metrics.ChromeProxyMetric())
305 322
306 def CustomizeBrowserOptions(self, options): 323 def CustomizeBrowserOptions(self, options):
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 self._metrics.AddResultsForDataSaving, 386 self._metrics.AddResultsForDataSaving,
370 ], 387 ],
371 'bypass': [self._metrics.AddResultsForBypass], 388 'bypass': [self._metrics.AddResultsForBypass],
372 } 389 }
373 if not self._page.name in page_to_metrics: 390 if not self._page.name in page_to_metrics:
374 raise page_test.MeasurementFailure( 391 raise page_test.MeasurementFailure(
375 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( 392 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % (
376 self._page.name, page_to_metrics.keys())) 393 self._page.name, page_to_metrics.keys()))
377 for add_result in page_to_metrics[self._page.name]: 394 for add_result in page_to_metrics[self._page.name]:
378 add_result(tab, results) 395 add_result(tab, results)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698