aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/rebaseline_server/imagepair.py
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-26 19:05:20 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-26 19:05:20 +0000
commit16f418080ff6751e15e0193263149412de9c848a (patch)
tree4704fbad68889e675a1a6c6a42723be715d8eb5e /gm/rebaseline_server/imagepair.py
parent1caedbb216703df58ce5ebe29955e53fa098d8dc (diff)
rebaseline_server: use new intermediate JSON format as described in https://goto.google.com/ChangingRbsJson
There are still some places in the frontend (HTML+Javascript) code where we assume we are handling expectations vs actuals, but there are just a few and we should be able to remove them easily in a coming CL. At that point, the frontend will work just as well for displaying any set of image pairs. BUG=skia:1919 NOTRY=True R=rmistry@google.com Author: epoger@google.com Review URL: https://codereview.chromium.org/178253010 git-svn-id: http://skia.googlecode.com/svn/trunk@13598 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm/rebaseline_server/imagepair.py')
-rw-r--r--gm/rebaseline_server/imagepair.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/gm/rebaseline_server/imagepair.py b/gm/rebaseline_server/imagepair.py
index bba36fa8c4..f02704e082 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