diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 20:27:35 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 20:27:35 +0000 |
commit | faf4d4d4a80456caf39fbc547763f80bee50acee (patch) | |
tree | f6b24ede0319248e2f4ad8d388bd89f220b47f32 /webkit | |
parent | d3ae7a0705a7f1a11831731a799f337055d54a85 (diff) | |
download | chromium_src-faf4d4d4a80456caf39fbc547763f80bee50acee.zip chromium_src-faf4d4d4a80456caf39fbc547763f80bee50acee.tar.gz chromium_src-faf4d4d4a80456caf39fbc547763f80bee50acee.tar.bz2 |
Fix build: missed a file
TBR=tony
Review URL: http://codereview.chromium.org/13209
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6449 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/layout_tests/test_types/fuzzy_image_diff.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/webkit/tools/layout_tests/test_types/fuzzy_image_diff.py b/webkit/tools/layout_tests/test_types/fuzzy_image_diff.py new file mode 100644 index 0000000..f90536a --- /dev/null +++ b/webkit/tools/layout_tests/test_types/fuzzy_image_diff.py @@ -0,0 +1,48 @@ +# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Compares the image output of a test to the expected image output using +fuzzy matching. +""" + +import errno +import logging +import os +import shutil +import subprocess + +from layout_package import path_utils +from layout_package import test_failures +from test_types import test_type_base + +class FuzzyImageDiff(test_type_base.TestTypeBase): + def CompareOutput(self, filename, proc, output, test_args): + """Implementation of CompareOutput that checks the output image and + checksum against the expected files from the LayoutTest directory. + """ + failures = [] + + # If we didn't produce a hash file, this test must be text-only. + if test_args.hash is None: + return failures + + expected_png_file = path_utils.ExpectedFilename(filename, + '.png', + self._platform) + + if test_args.show_sources: + logging.debug('Using %s' % expected_png_file) + + # Also report a missing expected PNG file. + if not os.path.isfile(expected_png_file): + failures.append(test_failures.FailureMissingImage(self)) + + # Run the fuzzymatcher + r = subprocess.call(['fuzzymatch', test_args.png_path, expected_png_file]) + print ' fuzzymatch returned', r + if r != 0: + failures.append(test_failures.FailureFuzzyFailure(self)) + + return failures + |