From 16f418080ff6751e15e0193263149412de9c848a Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Wed, 26 Feb 2014 19:05:20 +0000 Subject: 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 --- gm/rebaseline_server/imagepair.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gm/rebaseline_server/imagepair.py') 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 -- cgit v1.2.3