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

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

Issue 1044573002: Integration test for exp Chrome-Proxy request option (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 5 years, 8 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 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 def __init__(self): 303 def __init__(self):
304 super(ChromeProxyLoFi, self).__init__(restart_after_each_page=True) 304 super(ChromeProxyLoFi, self).__init__(restart_after_each_page=True)
305 305
306 def CustomizeBrowserOptions(self, options): 306 def CustomizeBrowserOptions(self, options):
307 super(ChromeProxyLoFi, self).CustomizeBrowserOptions(options) 307 super(ChromeProxyLoFi, self).CustomizeBrowserOptions(options)
308 options.AppendExtraBrowserArgs('--enable-data-reduction-proxy-lo-fi') 308 options.AppendExtraBrowserArgs('--enable-data-reduction-proxy-lo-fi')
309 309
310 def AddResults(self, tab, results): 310 def AddResults(self, tab, results):
311 self._metrics.AddResultsForLoFi(tab, results) 311 self._metrics.AddResultsForLoFi(tab, results)
312 312
313 class ChromeProxyExpDirective(ChromeProxyValidation):
314 """Correctness measurement for experiment directives in Chrome-Proxy header.
315
316 This test verifies that "exp=test" in the Chrome-Proxy request header
317 causes a bypass on the experiment test page.
318 """
319
320 def __init__(self):
321 super(ChromeProxyExpDirective, self).__init__(restart_after_each_page=True)
322
323 def CustomizeBrowserOptions(self, options):
324 super(ChromeProxyExpDirective, self).CustomizeBrowserOptions(options)
325 options.AppendExtraBrowserArgs('--data-reduction-proxy-experiment=test')
326
327 def AddResults(self, tab, results):
328 self._metrics.AddResultsForBypass(tab, results)
329
313 330
314 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation): 331 class ChromeProxyHTTPToDirectFallback(ChromeProxyValidation):
315 """Correctness measurement for HTTP proxy fallback to direct.""" 332 """Correctness measurement for HTTP proxy fallback to direct."""
316 333
317 def __init__(self): 334 def __init__(self):
318 super(ChromeProxyHTTPToDirectFallback, self).__init__( 335 super(ChromeProxyHTTPToDirectFallback, self).__init__(
319 restart_after_each_page=True) 336 restart_after_each_page=True)
320 337
321 def CustomizeBrowserOptions(self, options): 338 def CustomizeBrowserOptions(self, options):
322 super(ChromeProxyHTTPToDirectFallback, 339 super(ChromeProxyHTTPToDirectFallback,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 self._metrics.AddResultsForDataSaving, 399 self._metrics.AddResultsForDataSaving,
383 ], 400 ],
384 'bypass': [self._metrics.AddResultsForBypass], 401 'bypass': [self._metrics.AddResultsForBypass],
385 } 402 }
386 if not self._page.name in page_to_metrics: 403 if not self._page.name in page_to_metrics:
387 raise page_test.MeasurementFailure( 404 raise page_test.MeasurementFailure(
388 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % ( 405 'Invalid page name (%s) in smoke. Page name must be one of:\n%s' % (
389 self._page.name, page_to_metrics.keys())) 406 self._page.name, page_to_metrics.keys()))
390 for add_result in page_to_metrics[self._page.name]: 407 for add_result in page_to_metrics[self._page.name]:
391 add_result(tab, results) 408 add_result(tab, results)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698