Changeset 55372 in webkit


Ignore:
Timestamp:
Mar 1, 2010 11:36:23 AM (14 years ago)
Author:
dpranke@chromium.org
Message:

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
Location:
trunk/WebKitTools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r55363 r55372  
     12010-03-01  Dirk Pranke <dpranke@chromium.org>
     2
     3         Reviewed by David Levin.
     4
     5         new-chromium-webkit-tests --platform=mac-leopard diffs are backwards
     6         https://bugs.webkit.org/show_bug.cgi?id=35265
     7
     8         Some parts of the code passed arguments as
     9         "actual, expected" and some passed as "expected, actual".
     10         As you might imagine, this lead to great confusion and wrongness.
     11         Standardize on "expected, actual" as that's the order which is
     12         passed to the underlying diff tool.
     13
     14         Based on a patch by Eric Siedel <eric@webkit.org>.
     15
     16         * Scripts/webkitpy/layout_tests/port/base.py:
     17         * Scripts/webkitpy/layout_tests/port/chromium.py:
     18         * Scripts/webkitpy/layout_tests/port/test.py:
     19         * Scripts/webkitpy/layout_tests/test_types/image_diff.py
     20
    1212010-03-01  Chris Jerdonek  <cjerdonek@webkit.org>
    222
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py

    r55123 r55372  
    7676        raise NotImplementedError('Port.check_sys_deps')
    7777
    78     def compare_text(self, actual_text, expected_text):
     78    def compare_text(self, expected_text, actual_text):
    7979        """Return whether or not the two strings are *not* equal. This
    8080        routine is used to diff text output.
     
    8282        While this is a generic routine, we include it in the Port
    8383        interface so that it can be overriden for testing purposes."""
    84         return actual_text != expected_text
    85 
    86     def diff_image(self, actual_filename, expected_filename,
     84        return expected_text != actual_text
     85
     86    def diff_image(self, expected_filename, actual_filename,
    8787                   diff_filename=None):
    8888        """Compare two image files and produce a delta image file.
     
    9595        interface so that it can be overriden for testing purposes."""
    9696        executable = self._path_to_image_diff()
    97         cmd = [executable, '--diff', actual_filename, expected_filename]
     97        cmd = [executable, '--diff', expected_filename, actual_filename]
    9898        if diff_filename:
    9999            cmd.append(diff_filename)
     
    112112        return result
    113113
    114     def diff_text(self, actual_text, expected_text,
    115                   actual_filename, expected_filename):
     114    def diff_text(self, expected_text, actual_text,
     115                  expected_filename, actual_filename):
    116116        """Returns a string containing the diff of the two text strings
    117117        in 'unified diff' format.
     
    477477               '--start-insert=##WDIFF_ADD##',
    478478               '--end-insert=##WDIFF_END##',
    479                expected_filename,
    480                actual_filename]
     479               actual_filename,
     480               expected_filename]
    481481        global _wdiff_available
    482482        result = ''
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py

    r55123 r55372  
    9191        return result
    9292
    93     def compare_text(self, actual_text, expected_text):
    94         return actual_text != expected_text
    95 
    9693    def path_from_chromium_base(self, *comps):
    9794        """Returns the full path to path made by joining the top of the
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py

    r55268 r55372  
    5656        return True
    5757
    58     def diff_image(self, actual_filename, expected_filename,
     58    def diff_image(self, expected_filename, actual_filename,
    5959                   diff_filename=None):
    6060        return False
    6161
    62     def compare_text(self, actual_text, expected_text):
     62    def compare_text(self, expected_text, actual_text):
    6363        return False
    6464
    65     def diff_text(self, actual_text, expected_text,
    66                   actual_filename, expected_filename):
     65    def diff_text(self, expected_text, actual_text,
     66                  expected_filename, actual_filename):
    6767        return ''
    6868
     
    121121        return ''
    122122
    123     def wdiff_text(self, actual_filename, expected_filename):
     123    def wdiff_text(self, expected_filename, actual_filename):
    124124        return ''
    125125
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py

    r54449 r55372  
    9999        try:
    100100            _compare_available = True
    101             result = port.diff_image(actual_filename, expected_filename,
     101            result = port.diff_image(expected_filename, actual_filename,
    102102                                     diff_filename)
    103103        except ValueError:
Note: See TracChangeset for help on using the changeset viewer.