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

Unified Diff: content/test/gpu/gpu_tests/cloud_storage_test_base.py

Issue 865653004: Document and test that image_util.WritePngFile requires path end in 'png'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review feedback from sullivan. Created 5 years, 11 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 | « no previous file | tools/telemetry/telemetry/image_processing/image_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/gpu/gpu_tests/cloud_storage_test_base.py
diff --git a/content/test/gpu/gpu_tests/cloud_storage_test_base.py b/content/test/gpu/gpu_tests/cloud_storage_test_base.py
index 2a7438c0733b3e83460acefd1e977d32457b9f84..f22ce3fb17878fb4d04389fb11c3482e364f98f1 100644
--- a/content/test/gpu/gpu_tests/cloud_storage_test_base.py
+++ b/content/test/gpu/gpu_tests/cloud_storage_test_base.py
@@ -143,7 +143,7 @@ class ValidatorBase(page_test.PageTest):
# PNG to disk, following the pattern in bitmap_unittest.py. The key to
# avoiding PermissionErrors seems to be to not actually try to write to
# the temporary file object, but to re-open its name for all operations.
- temp_file = tempfile.NamedTemporaryFile().name
+ temp_file = tempfile.NamedTemporaryFile(suffix='.png').name
image_util.WritePngFile(bitmap, temp_file)
cloud_storage.Insert(bucket, name, temp_file, publicly_readable=public)
@@ -169,7 +169,7 @@ class ValidatorBase(page_test.PageTest):
# temporary file and gsutil's overwriting it.
if not self.options.refimg_cloud_storage_bucket:
raise Exception('--refimg-cloud-storage-bucket argument is required')
- temp_file = tempfile.NamedTemporaryFile().name
+ temp_file = tempfile.NamedTemporaryFile(suffix='.png').name
cloud_storage.Get(self.options.refimg_cloud_storage_bucket,
self._FormatReferenceImageName(img_name, page, tab),
temp_file)
« no previous file with comments | « no previous file | tools/telemetry/telemetry/image_processing/image_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698