summaryrefslogtreecommitdiffstats
path: root/tools/chrome_proxy
diff options
context:
space:
mode:
authorsclittle <sclittle@chromium.org>2014-11-06 11:25:32 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-06 19:25:48 +0000
commit63e86dee95107069f065aca5b4af7e4f2dd822a0 (patch)
tree3378af2cc24cf1743fd88c7f51eee15c42e2b3ee /tools/chrome_proxy
parentfe27afb06ad8fc0cfe28ace34c6df85fc7b43367 (diff)
downloadchromium_src-63e86dee95107069f065aca5b4af7e4f2dd822a0.zip
chromium_src-63e86dee95107069f065aca5b4af7e4f2dd822a0.tar.gz
chromium_src-63e86dee95107069f065aca5b4af7e4f2dd822a0.tar.bz2
Reduce flakiness of data reduction proxy integration tests.
Sometimes, the proxy information can be slow to come up on chrome://net-internals#proxy, and this is the main cause of the current flakiness in the chrome proxy integration tests. This change waits for up to 10 seconds for the proxy information to come up. BUG=427085 Review URL: https://codereview.chromium.org/707673002 Cr-Commit-Position: refs/heads/master@{#303066}
Diffstat (limited to 'tools/chrome_proxy')
-rw-r--r--tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
index 3796f1a..890261e 100644
--- a/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
+++ b/tools/chrome_proxy/integration_tests/chrome_proxy_metrics.py
@@ -7,6 +7,7 @@ import logging
import os
from integration_tests import network_metrics
+from telemetry.core import util
from telemetry.page import page_test
from telemetry.value import scalar
@@ -36,6 +37,15 @@ def GetProxyInfoFromNetworkInternals(tab, url='chrome://net-internals#proxy'):
js = f.read()
tab.ExecuteJavaScript(js)
tab.WaitForJavaScriptExpression('performance.timing.loadEventStart', 300)
+
+ # Sometimes, the proxy information on net_internals#proxy is slow to come up.
+ # In order to prevent this from causing tests to flake frequently, wait for
+ # up to 10 seconds for this information to appear.
+ def IsDataReductionProxyEnabled():
+ info = tab.EvaluateJavaScript('window.__getChromeProxyInfo()')
+ return info['enabled']
+
+ util.WaitFor(IsDataReductionProxyEnabled, 10)
info = tab.EvaluateJavaScript('window.__getChromeProxyInfo()')
return info