From c3b0965e8a96763c78915b2543a9a0983084320f Mon Sep 17 00:00:00 2001 From: bustamante Date: Thu, 8 Oct 2015 16:06:38 -0700 Subject: Add timeout to XHR request in the DRP check. This change is under the theory that our initial request hangs for some reason, and blocks future requests from succeeding until the browser is realunched. By setting a timeout Chrome will give up after 15 seconds. BUG=539639 Review URL: https://codereview.chromium.org/1400693002 Cr-Commit-Position: refs/heads/master@{#353165} --- tools/chrome_proxy/common/chrome_proxy_measurements.py | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/chrome_proxy') diff --git a/tools/chrome_proxy/common/chrome_proxy_measurements.py b/tools/chrome_proxy/common/chrome_proxy_measurements.py index b7f7515..1628cce 100644 --- a/tools/chrome_proxy/common/chrome_proxy_measurements.py +++ b/tools/chrome_proxy/common/chrome_proxy_measurements.py @@ -27,6 +27,7 @@ def WaitForViaHeader(tab, url="http://check.googlezip.net/test.html"): 'function ProbeViaHeader(url, wanted_via) {' 'try {' 'var xmlhttp = new XMLHttpRequest();' + 'xmlhttp.timeout = 15;' 'xmlhttp.open("HEAD",url,false);' 'xmlhttp.send();' 'var via=xmlhttp.getResponseHeader("via");' -- cgit v1.1