diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 21:12:12 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 21:12:12 +0000 |
commit | 481e0d05062f8cd4192db95b551fb4121b99fd7b (patch) | |
tree | 41e9cbd5d46b7f5f9bbcb37df3d5985791c8c39f /o3d/tests | |
parent | 1a8cb33717f86b14b90281824f29412e276fc91a (diff) | |
download | chromium_src-481e0d05062f8cd4192db95b551fb4121b99fd7b.zip chromium_src-481e0d05062f8cd4192db95b551fb4121b99fd7b.tar.gz chromium_src-481e0d05062f8cd4192db95b551fb4121b99fd7b.tar.bz2 |
Make selenium pass in 1.0 for alphaThreshold
It seems like short of writing a new diff program
the original idea of multiplying the alpha in
as RGB * (0.5 + alpha * 0.5) would give a better
test.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24012 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/tests')
-rw-r--r-- | o3d/tests/selenium/main.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/o3d/tests/selenium/main.py b/o3d/tests/selenium/main.py index 278ad67..5ac135a 100644 --- a/o3d/tests/selenium/main.py +++ b/o3d/tests/selenium/main.py @@ -794,6 +794,7 @@ def CompareScreenshots(browser, test_list, screencompare, screenshotsdir, continue pixel_threshold = "10" + alpha_threshold = "1.0" use_colorfactor = False use_downsample = False use_edge = True @@ -835,6 +836,7 @@ def CompareScreenshots(browser, test_list, screencompare, screenshotsdir, generated_file, "-output", diff_file, "-fov", "45", + "-alphaThreshold", alpha_threshold, # Turn on verbose output for the percetual diff so we # can see how far off we are on the threshold. "-verbose", @@ -870,6 +872,12 @@ def CompareScreenshots(browser, test_list, screencompare, screenshotsdir, if pixel_match: different_pixels = pixel_match.group(1) + alpha_re = re.compile("max alpha delta of ([0-9\.]+)", re.DOTALL) + alpha_delta = "0.0" + alpha_match = alpha_re.search(pdiff_stdout) + if alpha_match: + alpha_delta = alpha_match.group(1) + if (result == expected_result or (pixel_match and int(different_pixels) <= int(pixel_threshold))): # The perceptual diff passed. @@ -890,9 +898,10 @@ def CompareScreenshots(browser, test_list, screencompare, screenshotsdir, results.AddFailure( test_name, browser, ("Reference framebuffer (%s) does not match generated " - "file (%s): it differed by %s pixels with a threshold of %s." % - (reference_file, generated_file, different_pixels, - pixel_threshold))) + "file (%s): %s non-matching pixels, max alpha delta: %s, " + "threshold: %s, alphaThreshold: %s." % + (reference_file, generated_file, different_pixels, alpha_delta, + pixel_threshold, alpha_threshold))) else: # The perceptual diff failed for some reason other than # pixel differencing. |