Skip to content
Permalink
Browse files
2010-03-01 Dirk Pranke <dpranke@chromium.org>
         Reviewed by David Levin.

         new-chromium-webkit-tests --platform=mac-leopard diffs are backwards
         https://bugs.webkit.org/show_bug.cgi?id=35265

         Some parts of the code passed arguments as
         "actual, expected" and some passed as "expected, actual".
         As you might imagine, this lead to great confusion and wrongness.
         Standardize on "expected, actual" as that's the order which is
         passed to the underlying diff tool.

         Based on a patch by Eric Siedel <eric@webkit.org>.

         * Scripts/webkitpy/layout_tests/port/base.py:
         * Scripts/webkitpy/layout_tests/port/chromium.py:
         * Scripts/webkitpy/layout_tests/port/test.py:
         * Scripts/webkitpy/layout_tests/test_types/image_diff.py

Canonical link: https://commits.webkit.org/46673@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dpranke committed Mar 1, 2010
1 parent 66ff92c commit 7b55c6659b8bbb0c21aceb138dd1f7ece6c40360
Showing 5 changed files with 34 additions and 17 deletions.
@@ -1,3 +1,23 @@
2010-03-01 Dirk Pranke <dpranke@chromium.org>

Reviewed by David Levin.

new-chromium-webkit-tests --platform=mac-leopard diffs are backwards
https://bugs.webkit.org/show_bug.cgi?id=35265

Some parts of the code passed arguments as
"actual, expected" and some passed as "expected, actual".
As you might imagine, this lead to great confusion and wrongness.
Standardize on "expected, actual" as that's the order which is
passed to the underlying diff tool.

Based on a patch by Eric Siedel <eric@webkit.org>.

* Scripts/webkitpy/layout_tests/port/base.py:
* Scripts/webkitpy/layout_tests/port/chromium.py:
* Scripts/webkitpy/layout_tests/port/test.py:
* Scripts/webkitpy/layout_tests/test_types/image_diff.py

2010-03-01 Chris Jerdonek <cjerdonek@webkit.org>

Unreviewed.
@@ -75,15 +75,15 @@ def check_sys_deps(self, needs_http):
Returns whether the system is properly configured."""
raise NotImplementedError('Port.check_sys_deps')

def compare_text(self, actual_text, expected_text):
def compare_text(self, expected_text, actual_text):
"""Return whether or not the two strings are *not* equal. This
routine is used to diff text output.
While this is a generic routine, we include it in the Port
interface so that it can be overriden for testing purposes."""
return actual_text != expected_text
return expected_text != actual_text

def diff_image(self, actual_filename, expected_filename,
def diff_image(self, expected_filename, actual_filename,
diff_filename=None):
"""Compare two image files and produce a delta image file.
@@ -94,7 +94,7 @@ def diff_image(self, actual_filename, expected_filename,
While this is a generic routine, we include it in the Port
interface so that it can be overriden for testing purposes."""
executable = self._path_to_image_diff()
cmd = [executable, '--diff', actual_filename, expected_filename]
cmd = [executable, '--diff', expected_filename, actual_filename]
if diff_filename:
cmd.append(diff_filename)
result = 1
@@ -111,8 +111,8 @@ def diff_image(self, actual_filename, expected_filename,
pass
return result

def diff_text(self, actual_text, expected_text,
actual_filename, expected_filename):
def diff_text(self, expected_text, actual_text,
expected_filename, actual_filename):
"""Returns a string containing the diff of the two text strings
in 'unified diff' format.
@@ -476,8 +476,8 @@ def wdiff_text(self, actual_filename, expected_filename):
'--end-delete=##WDIFF_END##',
'--start-insert=##WDIFF_ADD##',
'--end-insert=##WDIFF_END##',
expected_filename,
actual_filename]
actual_filename,
expected_filename]
global _wdiff_available
result = ''
try:
@@ -90,9 +90,6 @@ def check_sys_deps(self, needs_http):

return result

def compare_text(self, actual_text, expected_text):
return actual_text != expected_text

def path_from_chromium_base(self, *comps):
"""Returns the full path to path made by joining the top of the
Chromium source tree and the list of path components in |*comps|."""
@@ -55,15 +55,15 @@ def baseline_search_path(self):
def check_sys_deps(self, needs_http):
return True

def diff_image(self, actual_filename, expected_filename,
def diff_image(self, expected_filename, actual_filename,
diff_filename=None):
return False

def compare_text(self, actual_text, expected_text):
def compare_text(self, expected_text, actual_text):
return False

def diff_text(self, actual_text, expected_text,
actual_filename, expected_filename):
def diff_text(self, expected_text, actual_text,
expected_filename, actual_filename):
return ''

def name(self):
@@ -120,7 +120,7 @@ def test_platform_names(self):
def version():
return ''

def wdiff_text(self, actual_filename, expected_filename):
def wdiff_text(self, expected_filename, actual_filename):
return ''


@@ -98,7 +98,7 @@ def _create_image_diff(self, port, filename, target):

try:
_compare_available = True
result = port.diff_image(actual_filename, expected_filename,
result = port.diff_image(expected_filename, actual_filename,
diff_filename)
except ValueError:
_compare_available = False

0 comments on commit 7b55c66

Please sign in to comment.