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

Unified Diff: tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py

Issue 2357723002: Add integration tests for QUIC (Closed)
Patch Set: Addressed comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py
index 1c6fdaa4ff07492e00d16a5c02764cb034070af7..d3c449201da80ac9c4bbd392d3e7e3195d29b5c5 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_measurements.py
@@ -279,6 +279,10 @@ class ChromeProxyClientType(ChromeProxyValidation):
metrics=metrics.ChromeProxyMetric())
self._chrome_proxy_client_type = None
+ def CustomizeBrowserOptions(self, options):
+ super(ChromeProxyClientType, self).CustomizeBrowserOptions(options)
+ options.AppendExtraBrowserArgs('--disable-quic')
+
def AddResults(self, tab, results):
# Get the Chrome-Proxy client type from the first page in the page set, so
# that the client type value can be used to determine which of the later
@@ -307,6 +311,7 @@ class ChromeProxyLoFi(ChromeProxyValidation):
# Disable server experiments such as tamper detection.
options.AppendExtraBrowserArgs(
'--data-reduction-proxy-server-experiments-disabled')
+ options.AppendExtraBrowserArgs('--disable-quic')
def AddResults(self, tab, results):
self._metrics.AddResultsForLoFi(tab, results)
@@ -334,6 +339,7 @@ class ChromeProxyCacheLoFiDisabled(ChromeProxyValidation):
def WillStartBrowser(self, platform):
super(ChromeProxyCacheLoFiDisabled, self).WillStartBrowser(platform)
+ self.options.AppendExtraBrowserArgs('--disable-quic')
if not self._page:
# First page load, enable LoFi and chrome proxy. Disable server
# experiments such as tamper detection.
@@ -386,6 +392,7 @@ class ChromeProxyCacheProxyDisabled(ChromeProxyValidation):
def WillStartBrowser(self, platform):
super(ChromeProxyCacheProxyDisabled, self).WillStartBrowser(platform)
+ self.options.AppendExtraBrowserArgs('--disable-quic')
if not self._page:
# First page load, enable LoFi and chrome proxy. Disable server
# experiments such as tamper detection.
@@ -422,6 +429,7 @@ class ChromeProxyLoFiPreview(ChromeProxyValidation):
'--data-reduction-proxy-lo-fi=always-on')
options.AppendExtraBrowserArgs(
'--enable-data-reduction-proxy-lo-fi-preview')
+ options.AppendExtraBrowserArgs('--disable-quic')
def AddResults(self, tab, results):
self._metrics.AddResultsForLoFiPreview(tab, results)
@@ -459,6 +467,7 @@ class ChromeProxyPassThrough(ChromeProxyValidation):
def CustomizeBrowserOptions(self, options):
super(ChromeProxyPassThrough, self).CustomizeBrowserOptions(options)
+ options.AppendExtraBrowserArgs('--disable-quic')
def AddResults(self, tab, results):
self._metrics.AddResultsForPassThrough(tab, results)
@@ -564,6 +573,58 @@ class ChromeProxySmoke(ChromeProxyValidation):
for add_result in page_to_metrics[self._page.name]:
add_result(tab, results)
+class ChromeProxyQuicSmoke(page_test.PageTest):
+ """Smoke measurement for basic chrome proxy correctness when using a
+ proxy that supports QUIC."""
+
+ def __init__(self, *args, **kwargs):
+ super(ChromeProxyQuicSmoke, self).__init__(*args, **kwargs)
+ self._metrics = metrics.ChromeProxyMetric()
+ self._enable_proxy = True
+
+ def CustomizeBrowserOptions(self, options):
+ super(ChromeProxyQuicSmoke, self).CustomizeBrowserOptions(options)
+ options.AppendExtraBrowserArgs(
+ '--enable-quic')
+ options.AppendExtraBrowserArgs(
+ '--data-reduction-proxy-http-proxies=https://proxy.googlezip.net:443')
+ options.AppendExtraBrowserArgs(
+ '--force-fieldtrials=DataReductionProxyUseQuic/Enabled')
+ options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth')
+
+ def WillNavigateToPage(self, page, tab):
+ if self._enable_proxy:
+ measurements.WaitForViaHeader(tab)
+ tab.ClearCache(force=True)
+ self._metrics.Start(page, tab)
+
+ def ValidateAndMeasurePage(self, page, tab, results):
+ # Wait for the load event.
+ tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ self._metrics.Stop(page, tab)
+ page_to_metrics = {
+ 'header validation': [self._metrics.AddResultsForHeaderValidation],
+ 'compression: image': [
+ self._metrics.AddResultsForHeaderValidation,
+ self._metrics.AddResultsForDataSaving,
+ ],
+ 'compression: javascript': [
+ self._metrics.AddResultsForHeaderValidation,
+ self._metrics.AddResultsForDataSaving,
+ ],
+ 'compression: css': [
+ self._metrics.AddResultsForHeaderValidation,
+ self._metrics.AddResultsForDataSaving,
+ ],
+ 'bypass': [self._metrics.AddResultsForBypass],
+ }
+ if not page.name in page_to_metrics:
+ raise page_test.MeasurementFailure(
+ 'Invalid page name (%s) in QUIC smoke. '
+ 'Page name must be one of:\n%s' % (
+ page.name, page_to_metrics.keys()))
+ for add_result in page_to_metrics[page.name]:
+ add_result(tab, results)
PROXIED = metrics.PROXIED
DIRECT = metrics.DIRECT
@@ -580,6 +641,7 @@ class ChromeProxyClientConfig(ChromeProxyValidation):
super(ChromeProxyClientConfig, self).CustomizeBrowserOptions(options)
options.AppendExtraBrowserArgs(
'--enable-data-reduction-proxy-config-client')
+ options.AppendExtraBrowserArgs('--disable-quic')
def AddResults(self, tab, results):
self._metrics.AddResultsForClientConfig(tab, results)
@@ -707,3 +769,35 @@ class ChromeProxyPingback(ChromeProxyValidation):
def AddResults(self, tab, results):
self._metrics.AddResultsForPingback(tab, results)
+
+class ChromeProxyQuicTransaction(page_test.PageTest):
+ """Chrome quic proxy usage validation when connecting to a proxy that
+ supports QUIC."""
+
+ def __init__(self, *args, **kwargs):
+ super(ChromeProxyQuicTransaction, self).__init__(*args, **kwargs)
+ self._metrics = metrics.ChromeProxyMetric()
+ self._enable_proxy = True
+
+ def CustomizeBrowserOptions(self, options):
+ options.AppendExtraBrowserArgs(
+ '--enable-quic')
+ options.AppendExtraBrowserArgs(
+ '--data-reduction-proxy-http-proxies=https://proxy.googlezip.net:443')
+ options.AppendExtraBrowserArgs(
+ '--force-fieldtrials=DataReductionProxyUseQuic/Enabled')
+ options.AppendExtraBrowserArgs('--enable-spdy-proxy-auth')
+ options.AppendExtraBrowserArgs(
+ '--enable-stats-collection-bindings')
+
+ def WillNavigateToPage(self, page, tab):
+ if self._enable_proxy:
+ measurements.WaitForViaHeader(tab)
+ tab.ClearCache(force=True)
+ self._metrics.Start(page, tab)
+
+ def ValidateAndMeasurePage(self, page, tab, results):
+ # Wait for the load event.
+ tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+ self._metrics.Stop(page, tab)
+ self._metrics.AddResultsForQuicTransaction(tab, results)

Powered by Google App Engine
This is Rietveld 408576698