| Differences between
and this patch
- a/WebKitTools/ChangeLog +20 lines
Lines 1-3 a/WebKitTools/ChangeLog_sec1
1
 2010-02-26  Dirk Pranke <dpranke@chromium.org>
2
3
         Reviewed by NOBODY (OOPS!).
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
1
2010-02-26  Antonio Gomes  <tonikitoo@webkit.org>
21
2010-02-26  Antonio Gomes  <tonikitoo@webkit.org>
2
22
3
        Reviewed by Gustavo Noronha.
23
        Reviewed by Gustavo Noronha.
- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py -8 / +8 lines
Lines 75-89 class Port(object): a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py_sec1
75
        Returns whether the system is properly configured."""
75
        Returns whether the system is properly configured."""
76
        raise NotImplementedError('Port.check_sys_deps')
76
        raise NotImplementedError('Port.check_sys_deps')
77
77
78
    def compare_text(self, actual_text, expected_text):
78
    def compare_text(self, expected_text, actual_text):
79
        """Return whether or not the two strings are *not* equal. This
79
        """Return whether or not the two strings are *not* equal. This
80
        routine is used to diff text output.
80
        routine is used to diff text output.
81
81
82
        While this is a generic routine, we include it in the Port
82
        While this is a generic routine, we include it in the Port
83
        interface so that it can be overriden for testing purposes."""
83
        interface so that it can be overriden for testing purposes."""
84
        return actual_text != expected_text
84
        return expected_text != actual_text
85
85
86
    def diff_image(self, actual_filename, expected_filename,
86
    def diff_image(self, expected_filename, actual_filename,
87
                   diff_filename=None):
87
                   diff_filename=None):
88
        """Compare two image files and produce a delta image file.
88
        """Compare two image files and produce a delta image file.
89
89
Lines 94-100 class Port(object): a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py_sec2
94
        While this is a generic routine, we include it in the Port
94
        While this is a generic routine, we include it in the Port
95
        interface so that it can be overriden for testing purposes."""
95
        interface so that it can be overriden for testing purposes."""
96
        executable = self._path_to_image_diff()
96
        executable = self._path_to_image_diff()
97
        cmd = [executable, '--diff', actual_filename, expected_filename]
97
        cmd = [executable, '--diff', expected_filename, actual_filename]
98
        if diff_filename:
98
        if diff_filename:
99
            cmd.append(diff_filename)
99
            cmd.append(diff_filename)
100
        result = 1
100
        result = 1
Lines 111-118 class Port(object): a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py_sec3
111
            pass
111
            pass
112
        return result
112
        return result
113
113
114
    def diff_text(self, actual_text, expected_text,
114
    def diff_text(self, expected_text, actual_text,
115
                  actual_filename, expected_filename):
115
                  expected_filename, actual_filename):
116
        """Returns a string containing the diff of the two text strings
116
        """Returns a string containing the diff of the two text strings
117
        in 'unified diff' format.
117
        in 'unified diff' format.
118
118
Lines 476-483 class Port(object): a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py_sec4
476
               '--end-delete=##WDIFF_END##',
476
               '--end-delete=##WDIFF_END##',
477
               '--start-insert=##WDIFF_ADD##',
477
               '--start-insert=##WDIFF_ADD##',
478
               '--end-insert=##WDIFF_END##',
478
               '--end-insert=##WDIFF_END##',
479
               expected_filename,
479
               actual_filename,
480
               actual_filename]
480
               expected_filename]
481
        global _wdiff_available
481
        global _wdiff_available
482
        result = ''
482
        result = ''
483
        try:
483
        try:
- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py -3 lines
Lines 90-98 class ChromiumPort(base.Port): a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py_sec1
90
90
91
        return result
91
        return result
92
92
93
    def compare_text(self, actual_text, expected_text):
94
        return actual_text != expected_text
95
96
    def path_from_chromium_base(self, *comps):
93
    def path_from_chromium_base(self, *comps):
97
        """Returns the full path to path made by joining the top of the
94
        """Returns the full path to path made by joining the top of the
98
        Chromium source tree and the list of path components in |*comps|."""
95
        Chromium source tree and the list of path components in |*comps|."""
- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py -5 / +5 lines
Lines 55-69 class TestPort(base.Port): a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py_sec1
55
    def check_sys_deps(self, needs_http):
55
    def check_sys_deps(self, needs_http):
56
        return True
56
        return True
57
57
58
    def diff_image(self, actual_filename, expected_filename,
58
    def diff_image(self, expected_filename, actual_filename,
59
                   diff_filename=None):
59
                   diff_filename=None):
60
        return False
60
        return False
61
61
62
    def compare_text(self, actual_text, expected_text):
62
    def compare_text(self, expected_text, actual_text):
63
        return False
63
        return False
64
64
65
    def diff_text(self, actual_text, expected_text,
65
    def diff_text(self, expected_text, actual_text,
66
                  actual_filename, expected_filename):
66
            expected_filename, actual_filename):
67
        return ''
67
        return ''
68
68
69
    def name(self):
69
    def name(self):
Lines 120-126 class TestPort(base.Port): a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py_sec2
120
    def version():
120
    def version():
121
        return ''
121
        return ''
122
122
123
    def wdiff_text(self, actual_filename, expected_filename):
123
    def wdiff_text(self, expected_filename, actual_filename):
124
        return ''
124
        return ''
125
125
126
126
- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py -1 / +1 lines
Lines 98-104 class ImageDiff(test_type_base.TestTypeBase): a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py_sec1
98
98
99
        try:
99
        try:
100
            _compare_available = True
100
            _compare_available = True
101
            result = port.diff_image(actual_filename, expected_filename,
101
            result = port.diff_image(expected_filename, actual_filename,
102
                                     diff_filename)
102
                                     diff_filename)
103
        except ValueError:
103
        except ValueError:
104
            _compare_available = False
104
            _compare_available = False

Return to Bug 35265