diff options
author | victorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 16:00:02 +0000 |
---|---|---|
committer | victorw@chromium.org <victorw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-26 16:00:02 +0000 |
commit | 68ca65b4b491227c84a1431d313b117eef17d4bb (patch) | |
tree | 433639b9d601fda37496fd0e0781bf110694ca8a /webkit | |
parent | 6537e06f82e531fa332271b73a08461bc67d47fc (diff) | |
download | chromium_src-68ca65b4b491227c84a1431d313b117eef17d4bb.zip chromium_src-68ca65b4b491227c84a1431d313b117eef17d4bb.tar.gz chromium_src-68ca65b4b491227c84a1431d313b117eef17d4bb.tar.bz2 |
Always add actual png file to layout test results directory
If the expected results for a test is missing, run_webkit_tests
outputs the actual txt and checksum but not png file. The actual
png should be archived in this case.
BUG=15367
TEST=none
Review URL: http://codereview.chromium.org/149016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/layout_tests/test_types/image_diff.py | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/webkit/tools/layout_tests/test_types/image_diff.py b/webkit/tools/layout_tests/test_types/image_diff.py index ba5f391..9061c27 100644 --- a/webkit/tools/layout_tests/test_types/image_diff.py +++ b/webkit/tools/layout_tests/test_types/image_diff.py @@ -137,32 +137,29 @@ class ImageDiff(test_type_base.TestTypeBase): raise expected_hash = '' - if test_args.hash != expected_hash: - if expected_hash == '': - failures.append(test_failures.FailureMissingImageHash(self)) - else: - # Hashes don't match, so see if the images match. If they do, then - # the hash is wrong. - self._CopyOutputPNGs(filename, test_args.png_path, - expected_png_file) - result = self._CreateImageDiff(filename, target) - if result == 0: - failures.append(test_failures.FailureImageHashIncorrect(self)) - else: - failures.append(test_failures.FailureImageHashMismatch(self)) - - # Also report a missing expected PNG file. if not os.path.isfile(expected_png_file): + # Report a missing expected PNG file. failures.append(test_failures.FailureMissingImage(self)) + elif test_args.hash == expected_hash: + return failure + + self._CopyOutputPNGs(filename, test_args.png_path, + expected_png_file) + # Even though we only use result in one codepath below but we still need to + # call CreateImageDiff for other codepaths. + result = self._CreateImageDiff(filename, target) + + if expected_hash == '': + failures.append(test_failures.FailureMissingImageHash(self)) + elif test_args.hash != expected_hash: + # Hashes don't match, so see if the images match. If they do, then + # the hash is wrong. + if result == 0: + failures.append(test_failures.FailureImageHashIncorrect(self)) + else: + failures.append(test_failures.FailureImageHashMismatch(self)) - # If anything was wrong, write the output files. - if len(failures): - self.WriteOutputFiles(filename, '', '.checksum', test_args.hash, - expected_hash, diff=False, wdiff=False) - - if (test_args.hash == expected_hash or expected_hash != ''): - self._CopyOutputPNGs(filename, test_args.png_path, - expected_png_file) - self._CreateImageDiff(filename, target) + self.WriteOutputFiles(filename, '', '.checksum', test_args.hash, + expected_hash, diff=False, wdiff=False) return failures |