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

Unified Diff: tools/telemetry/telemetry/page/cloud_storage.py

Issue 106523006: Add options to GPU pixel test to use cloud storage for reference and error images. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed problems with temp files on Windows. Undid changes to Bitmap. Created 7 years 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 | « content/test/gpu/gpu_tests/pixel.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/page/cloud_storage.py
diff --git a/tools/telemetry/telemetry/page/cloud_storage.py b/tools/telemetry/telemetry/page/cloud_storage.py
index 7d07466a6a49d5415ef00552f3945f0da089d999..f27e35507954c4a14edb085707a6d64baf976857 100644
--- a/tools/telemetry/telemetry/page/cloud_storage.py
+++ b/tools/telemetry/telemetry/page/cloud_storage.py
@@ -109,6 +109,12 @@ def List(bucket):
stdout = _RunCommand(['ls', 'gs://%s' % bucket])
return [url.split('/')[-1] for url in stdout.splitlines()]
+def Exists(bucket, remote_path):
+ try:
+ _RunCommand(['ls', 'gs://%s/%s' % (bucket, remote_path)])
+ return True
+ except NotFoundError:
+ return False
def Delete(bucket, remote_path):
url = 'gs://%s/%s' % (bucket, remote_path)
@@ -122,10 +128,16 @@ def Get(bucket, remote_path, local_path):
_RunCommand(['cp', url, local_path])
-def Insert(bucket, remote_path, local_path):
+def Insert(bucket, remote_path, local_path, publicly_readable=False):
url = 'gs://%s/%s' % (bucket, remote_path)
- logging.info('Uploading %s to %s' % (local_path, url))
- _RunCommand(['cp', local_path, url])
+ command_and_args = ['cp']
+ extra_info = ''
+ if publicly_readable:
+ command_and_args += ['-a', 'public-read']
+ extra_info = ' (publicly readable)'
+ command_and_args += [local_path, url]
+ logging.info('Uploading %s to %s%s' % (local_path, url, extra_info))
+ _RunCommand(command_and_args)
def GetIfChanged(bucket, file_path):
« no previous file with comments | « content/test/gpu/gpu_tests/pixel.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698