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

Unified Diff: pyautolib/fetch_prebuilt_pyauto.py

Issue 10384104: Chrome updater test framework (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/test/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « install_test/sample_updater.py ('k') | pyautolib/pyauto_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pyautolib/fetch_prebuilt_pyauto.py
===================================================================
--- pyautolib/fetch_prebuilt_pyauto.py (revision 160412)
+++ pyautolib/fetch_prebuilt_pyauto.py (working copy)
@@ -80,7 +80,7 @@
}[self._options.platform]
for name in linux_names:
zip_name = 'chrome-' + name
- if self._DoesURLExist('%s/%s.zip' % (self._url, zip_name)):
+ if pyauto_utils.DoesUrlExist('%s/%s.zip' % (self._url, zip_name)):
self._chrome_zip_name = zip_name
break
else:
@@ -123,16 +123,6 @@
last_change))
return last_change_url
- def _DoesURLExist(self, url):
- """Determines whether a resource exists at the given URL."""
- parsed = urlparse.urlparse(url)
- conn = httplib.HTTPConnection(parsed.netloc)
- conn.request('HEAD', parsed.path)
- response = conn.getresponse()
- if response.status == 302: # Redirect; follow it.
- return self._DoesURLExist(response.getheader('location'))
- return response.status == 200
-
def Cleanup(self):
"""Remove old binaries, if any."""
pass
@@ -141,7 +131,7 @@
self._ParseArgs()
if not os.path.isdir(self._outdir):
os.makedirs(self._outdir)
- get_remoting = self._DoesURLExist(self._remoting_zip_url)
+ get_remoting = pyauto_utils.DoesUrlExist(self._remoting_zip_url)
# Fetch chrome & pyauto binaries
print 'Fetching', self._chrome_zip_url
« no previous file with comments | « install_test/sample_updater.py ('k') | pyautolib/pyauto_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698