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

Unified Diff: src/platform/dev/update_test.py

Issue 1238003: Fix devserver's handling of static images. (Closed)
Patch Set: Fix minor issues with update zip file, etc. Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/dev/devserver.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/dev/update_test.py
diff --git a/src/platform/dev/update_test.py b/src/platform/dev/update_test.py
index 7c726948c6c033cfd5bf6910d4b89b13d8ee9d77..bdd340b2369f67b6ca71019a64eb08928101d4c2 100755
--- a/src/platform/dev/update_test.py
+++ b/src/platform/dev/update_test.py
@@ -80,15 +80,15 @@ def _verify_response(data):
try:
fd = urllib2.urlopen(head_request)
except urllib2.HTTPError, e:
+ # HTTP error
print 'FAILED: unable to retrieve %s\n\t%s' % (update_url, e)
- return False
- length = int(fd.headers.getheaders('Content-Length')[0])
- assert length > 0
- print 'Got a valid update response.'
- fd.close()
- assert (urllib2.urlopen(urljoin(update_url, 'cksum')).read() == hash)
- print 'Update cksum matched the one in the update XML.'
- return _verify_download(update_url, length)
+ length = 0
+ else:
+ # HTTP succeeded
+ length = int(fd.headers.getheaders('Content-Length')[0])
+ finally:
+ fd.close()
+ return (length > 0)
def test(num_clients):
# Fake some concurrent requests for each autoupdate operation.
« no previous file with comments | « src/platform/dev/devserver.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698