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

Unified Diff: gm/rebaseline_server/imagepair.py

Issue 178253010: rebaseline_server: use new intermediate JSON format (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: incorporate Ravi's suggestions Created 6 years, 10 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 | « gm/rebaseline_server/imagediffdb.py ('k') | gm/rebaseline_server/imagepair_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/rebaseline_server/imagepair.py
diff --git a/gm/rebaseline_server/imagepair.py b/gm/rebaseline_server/imagepair.py
index bba36fa8c4b4e47ab8101e1bcb580cba6095dee6..f02704e0820e3212c5a4bea81d0a929abb7066b9 100644
--- a/gm/rebaseline_server/imagepair.py
+++ b/gm/rebaseline_server/imagepair.py
@@ -12,6 +12,7 @@ ImagePair class (see class docstring for details)
import posixpath
# Keys used within ImagePair dictionary representations.
+# NOTE: Keep these in sync with static/constants.js
KEY__DIFFERENCE_DATA = 'differenceData'
KEY__EXPECTATIONS_DATA = 'expectations'
KEY__EXTRA_COLUMN_VALUES = 'extraColumns'
@@ -31,8 +32,10 @@ class ImagePair(object):
Args:
image_diff_db: ImageDiffDB instance we use to generate/store image diffs
base_url: base of all image URLs
- imageA_relative_url: URL pointing at an image, relative to base_url
- imageB_relative_url: URL pointing at an image, relative to base_url
+ imageA_relative_url: string; URL pointing at an image, relative to
+ base_url; or None, if this image is missing
+ imageB_relative_url: string; URL pointing at an image, relative to
+ base_url; or None, if this image is missing
expectations: optional dictionary containing expectations-specific
metadata (ignore-failure, bug numbers, etc.)
extra_columns: optional dictionary containing more metadata (test name,
@@ -43,7 +46,9 @@ class ImagePair(object):
self.imageB_relative_url = imageB_relative_url
self.expectations_dict = expectations
self.extra_columns_dict = extra_columns
- if imageA_relative_url == imageB_relative_url:
+ if not imageA_relative_url or not imageB_relative_url:
+ self.diff_record = None
+ elif imageA_relative_url == imageB_relative_url:
self.diff_record = None
else:
# TODO(epoger): Rather than blocking until image_diff_db can read in
« no previous file with comments | « gm/rebaseline_server/imagediffdb.py ('k') | gm/rebaseline_server/imagepair_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698