| Differences between
and this patch
- a/Tools/ChangeLog +28 lines
Lines 1-5 a/Tools/ChangeLog_sec1
1
2012-01-09  Dirk Pranke  <dpranke@chromium.org>
1
2012-01-09  Dirk Pranke  <dpranke@chromium.org>
2
2
3
        webkitpy.layout_tests.port.mock_drt_unittest.MockChromiumDRTTest has been failing on cr-win
4
        https://bugs.webkit.org/show_bug.cgi?id=75884
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Fix regression introduced (revealed?) in r104340. Chromium file         
9
        url syntax is different on win32 and the test results weren't           
10
        expecting that.                                                         
11
12
        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
13
        (TestExpectations._report_errors):
14
        * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
15
        (test_parse_error_nonfatal):
16
        * Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py:
17
        (MockDRTTest.input_line):
18
        (MockChromiumDRTTest.test_pixeltest__fails):
19
        * Scripts/webkitpy/layout_tests/port/test.py:
20
        * Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py:
21
        (TestRebaseliner.make_rebaseliner):
22
        (TestRebaseliner.test_one_platform):
23
        (TestRebaseliner.test_all_platforms):
24
        (TestRebaseliner.test_png_file_with_comment):
25
        (TestRebaseliner.test_png_file_with_comment_remove_old_checksum):
26
        (TestRebaseliner.test_png_file_with_comment_as_duplicate):
27
        (TestRealMain.test_all_platforms):
28
29
2012-01-09  Dirk Pranke  <dpranke@chromium.org>
30
3
        Fix regression in test-webkitpy introduced by removing the webkitpy/python24 directory.
31
        Fix regression in test-webkitpy introduced by removing the webkitpy/python24 directory.
4
32
5
        Unreviewed, build fix.
33
        Unreviewed, build fix.
- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py -3 / +1 lines
Lines 789-798 class TestExpectations(object): a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py_sec1
789
            warnings.append(warning)
789
            warnings.append(warning)
790
790
791
        if len(errors) or len(warnings):
791
        if len(errors) or len(warnings):
792
            webkit_base_path = self._port.webkit_base()
793
            test_expectation_path = self._port.path_to_test_expectations_file()
792
            test_expectation_path = self._port.path_to_test_expectations_file()
794
            test_expectation_relative_path = test_expectation_path[len(webkit_base_path):].lstrip('/')
793
            failure_title = "FAILURES FOR %s in %s" % (str(self._test_config), test_expectation_path)
795
            failure_title = "FAILURES FOR %s in %s" % (str(self._test_config), test_expectation_relative_path)
796
            _log.error(failure_title)
794
            _log.error(failure_title)
797
795
798
            for error in errors:
796
            for error in errors:
- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py -2 / +2 lines
Lines 199-205 SKIP : failures/expected/image.html""") a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py_sec1
199
            self.assertFalse(True, "ParseError wasn't raised")
199
            self.assertFalse(True, "ParseError wasn't raised")
200
        except ParseError, e:
200
        except ParseError, e:
201
            self.assertTrue(e.fatal)
201
            self.assertTrue(e.fatal)
202
            exp_errors = [u"FAILURES FOR %s in LayoutTests/platform/test/test_expectations.txt" % self._port.test_configuration(),
202
            exp_errors = [u"FAILURES FOR %s in %s" % (self._port.test_configuration(), self._port.path_to_test_expectations_file()),
203
                          u"Line:1 Unrecognized modifier 'foo' failures/expected/text.html",
203
                          u"Line:1 Unrecognized modifier 'foo' failures/expected/text.html",
204
                          u"Line:2 Missing expectations SKIP : failures/expected/image.html"]
204
                          u"Line:2 Missing expectations SKIP : failures/expected/image.html"]
205
            self.assertEqual(str(e), '\n'.join(map(str, exp_errors)))
205
            self.assertEqual(str(e), '\n'.join(map(str, exp_errors)))
Lines 212-218 SKIP : failures/expected/image.html""") a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py_sec2
212
            self.assertFalse(True, "ParseError wasn't raised")
212
            self.assertFalse(True, "ParseError wasn't raised")
213
        except ParseError, e:
213
        except ParseError, e:
214
            self.assertFalse(e.fatal)
214
            self.assertFalse(e.fatal)
215
            exp_errors = [u'FAILURES FOR %s in LayoutTests/platform/test/test_expectations.txt' % self._port.test_configuration(),
215
            exp_errors = [u'FAILURES FOR %s in %s' % (self._port.test_configuration(), self._port.path_to_test_expectations_file()),
216
                          u'Line:1 Test lacks BUG modifier. failures/expected/text.html']
216
                          u'Line:1 Test lacks BUG modifier. failures/expected/text.html']
217
            self.assertEqual(str(e), '\n'.join(map(str, exp_errors)))
217
            self.assertEqual(str(e), '\n'.join(map(str, exp_errors)))
218
            self.assertEqual(e.errors, exp_errors)
218
            self.assertEqual(e.errors, exp_errors)
- a/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py -7 / +7 lines
Lines 90-101 class MockDRTPortTest(port_testcase.PortTestCase): a/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py_sec1
90
class MockDRTTest(unittest.TestCase):
90
class MockDRTTest(unittest.TestCase):
91
    def input_line(self, port, test_name, checksum=None):
91
    def input_line(self, port, test_name, checksum=None):
92
        url = port.create_driver(0).test_to_uri(test_name)
92
        url = port.create_driver(0).test_to_uri(test_name)
93
        # FIXME: we shouldn't have to work around platform-specific issues
93
        if url.startswith('file://'):
94
        # here.
94
            if sys.platform == 'win32':
95
        if url.startswith('file:////'):
95
                url = url[len('file:///'):]
96
            url = url[len('file:////') - 1:]
96
            else:
97
        if url.startswith('file:///'):
97
                url = url[len('file://'):]
98
            url = url[len('file:///') - 1:]
99
98
100
        if checksum:
99
        if checksum:
101
            return url + "'" + checksum + '\n'
100
            return url + "'" + checksum + '\n'
Lines 236-244 class MockChromiumDRTTest(MockDRTTest): a/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py_sec2
236
235
237
    def test_pixeltest__fails(self):
236
    def test_pixeltest__fails(self):
238
        host = MockHost()
237
        host = MockHost()
238
        url = '#URL:file://%s/failures/expected/checksum.html' % host.port_factory.get('test').layout_tests_dir()
239
        self.assertTest('failures/expected/checksum.html', pixel_tests=True,
239
        self.assertTest('failures/expected/checksum.html', pixel_tests=True,
240
            expected_checksum='wrong-checksum',
240
            expected_checksum='wrong-checksum',
241
            drt_output=['#URL:file:///test.checkout/LayoutTests/failures/expected/checksum.html\n',
241
            drt_output=[url + '\n',
242
                        '#MD5:checksum-checksum\n',
242
                        '#MD5:checksum-checksum\n',
243
                        'checksum-txt',
243
                        'checksum-txt',
244
                        '\n',
244
                        '\n',
- a/Tools/Scripts/webkitpy/layout_tests/port/test.py -1 / +5 lines
Lines 31-36 a/Tools/Scripts/webkitpy/layout_tests/port/test.py_sec1
31
from __future__ import with_statement
31
from __future__ import with_statement
32
32
33
import base64
33
import base64
34
import sys
34
import time
35
import time
35
36
36
from webkitpy.layout_tests.port import Port, Driver, DriverOutput
37
from webkitpy.layout_tests.port import Port, Driver, DriverOutput
Lines 220-226 layer at (0,0) size 800x34 a/Tools/Scripts/webkitpy/layout_tests/port/test.py_sec2
220
# this works. The path contains a '.' in the name because we've seen bugs
221
# this works. The path contains a '.' in the name because we've seen bugs
221
# related to this before.
222
# related to this before.
222
223
223
LAYOUT_TEST_DIR = '/test.checkout/LayoutTests'
224
if sys.platform == 'win32':
225
    LAYOUT_TEST_DIR = 'c:/test.checkout/LayoutTests'
226
else:
227
    LAYOUT_TEST_DIR = '/test.checkout/LayoutTests'
224
228
225
229
226
# Here we synthesize an in-memory filesystem from the test list
230
# Here we synthesize an in-memory filesystem from the test list
- a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py -23 / +28 lines
Lines 195-201 class TestRebaseliner(unittest.TestCase): a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec1
195
        zip_factory = test_zip_factory()
195
        zip_factory = test_zip_factory()
196
196
197
        # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently.
197
        # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently.
198
        filesystem.chdir("/test.checkout")
198
        filesystem.chdir(filesystem.dirname(host_port_obj.layout_tests_dir()))
199
199
200
        rebaseliner = rebaseline_chromium_webkit_tests.Rebaseliner(host, host_port_obj,
200
        rebaseliner = rebaseline_chromium_webkit_tests.Rebaseliner(host, host_port_obj,
201
            target_port_obj, platform, options, url_fetcher, zip_factory)
201
            target_port_obj, platform, options, url_fetcher, zip_factory)
Lines 227-260 class TestRebaseliner(unittest.TestCase): a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec2
227
            "BUGX REBASELINE MAC : failures/expected/image.html = IMAGE")
227
            "BUGX REBASELINE MAC : failures/expected/image.html = IMAGE")
228
228
229
        rebaseliner.run()
229
        rebaseliner.run()
230
        layout_test_dir = rebaseliner._port.layout_tests_dir()
230
        # We expect to have written 13 files over the course of this rebaseline:
231
        # We expect to have written 13 files over the course of this rebaseline:
231
        # *) 3 files in /__im_tmp for the extracted archive members
232
        # *) 3 files in /__im_tmp for the extracted archive members
232
        # *) 3 new baselines under '/test.checkout/LayoutTests'
233
        # *) 3 new baselines under layout_test_dir
233
        # *) 4 files in /tmp for the new and old baselines in the result file
234
        # *) 4 files in /tmp for the new and old baselines in the result file
234
        #    (-{old,new}.{txt,png}
235
        #    (-{old,new}.{txt,png}
235
        # *) 1 text diff in /tmp for the result file (-diff.txt).
236
        # *) 1 text diff in /tmp for the result file (-diff.txt).
236
        # *) 1 image diff in /tmp for the result file (-diff.png).
237
        # *) 1 image diff in /tmp for the result file (-diff.png).
237
        # *) 1 updated test_expectations file
238
        # *) 1 updated test_expectations file
238
        self.assertEqual(len(filesystem.written_files), 13)
239
        self.assertEqual(len(filesystem.written_files), 13)
239
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
240
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
240
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
241
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
241
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
242
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
242
243
243
    def test_all_platforms(self):
244
    def test_all_platforms(self):
244
        rebaseliner, filesystem = self.make_rebaseliner(
245
        rebaseliner, filesystem = self.make_rebaseliner(
245
            "BUGX REBASELINE : failures/expected/image.html = IMAGE")
246
            "BUGX REBASELINE : failures/expected/image.html = IMAGE")
247
        layout_test_dir = rebaseliner._port.layout_tests_dir()
246
        rebaseliner.run()
248
        rebaseliner.run()
247
        # See comment in test_one_platform for an explanation of the 13 written tests.
249
        # See comment in test_one_platform for an explanation of the 13 written tests.
248
        # Note that even though the rebaseline is marked for all platforms, each
250
        # Note that even though the rebaseline is marked for all platforms, each
249
        # rebaseliner only ever does one.
251
        # rebaseliner only ever does one.
250
        self.assertEqual(len(filesystem.written_files), 13)
252
        self.assertEqual(len(filesystem.written_files), 13)
251
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
253
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
252
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
254
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
253
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
255
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
254
256
255
    def test_png_file_with_comment(self):
257
    def test_png_file_with_comment(self):
256
        rebaseliner, filesystem = self.make_rebaseliner(
258
        rebaseliner, filesystem = self.make_rebaseliner(
257
            "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
259
            "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
260
        layout_test_dir = rebaseliner._port.layout_tests_dir()
258
        compile_success = rebaseliner._compile_rebaselining_tests()
261
        compile_success = rebaseliner._compile_rebaselining_tests()
259
        self.assertTrue(compile_success)
262
        self.assertTrue(compile_success)
260
        self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests)
263
        self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests)
Lines 262-277 class TestRebaseliner(unittest.TestCase): a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec3
262
        # There is one less file written than |test_one_platform| because we only
265
        # There is one less file written than |test_one_platform| because we only
263
        # write 2 expectations (the png and the txt file).
266
        # write 2 expectations (the png and the txt file).
264
        self.assertEqual(len(filesystem.written_files), 12)
267
        self.assertEqual(len(filesystem.written_files), 12)
265
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
268
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
266
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
269
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
267
        self.assertFalse(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None))
270
        self.assertFalse(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None))
268
271
269
    def test_png_file_with_comment_remove_old_checksum(self):
272
    def test_png_file_with_comment_remove_old_checksum(self):
270
        rebaseliner, filesystem = self.make_rebaseliner(
273
        rebaseliner, filesystem = self.make_rebaseliner(
271
            "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
274
            "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
272
        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'] = 'old'
275
        layout_test_dir = rebaseliner._port.layout_tests_dir()
273
        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum'] = 'old'
276
        filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'] = 'old'
274
        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'] = 'old'
277
        filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum'] = 'old'
278
        filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'] = 'old'
275
279
276
        compile_success = rebaseliner._compile_rebaselining_tests()
280
        compile_success = rebaseliner._compile_rebaselining_tests()
277
        self.assertTrue(compile_success)
281
        self.assertTrue(compile_success)
Lines 280-302 class TestRebaseliner(unittest.TestCase): a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec4
280
        # There is one more file written than |test_png_file_with_comment_remove_old_checksum|
284
        # There is one more file written than |test_png_file_with_comment_remove_old_checksum|
281
        # because we also delete the old checksum.
285
        # because we also delete the old checksum.
282
        self.assertEqual(len(filesystem.written_files), 13)
286
        self.assertEqual(len(filesystem.written_files), 13)
283
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
287
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
284
        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
288
        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
285
        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
289
        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
286
290
287
    def test_png_file_with_comment_as_duplicate(self):
291
    def test_png_file_with_comment_as_duplicate(self):
288
        rebaseliner, filesystem = self.make_rebaseliner(
292
        rebaseliner, filesystem = self.make_rebaseliner(
289
            "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
293
            "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
290
        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.png'] = 'tEXtchecksum\x000123456789'
294
        layout_test_dir = rebaseliner._port.layout_tests_dir()
291
        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.txt'] = 'png-comment-txt'
295
        filesystem.files[layout_test_dir + '/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.png'] = 'tEXtchecksum\x000123456789'
296
        filesystem.files[layout_test_dir + '/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.txt'] = 'png-comment-txt'
292
297
293
        compile_success = rebaseliner._compile_rebaselining_tests()
298
        compile_success = rebaseliner._compile_rebaselining_tests()
294
        self.assertTrue(compile_success)
299
        self.assertTrue(compile_success)
295
        self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests)
300
        self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests)
296
        rebaseliner.run()
301
        rebaseliner.run()
297
        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png', None), None)
302
        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png', None), None)
298
        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt', None), None)
303
        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt', None), None)
299
        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
304
        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
300
305
301
    def test_diff_baselines_txt(self):
306
    def test_diff_baselines_txt(self):
302
        rebaseliner, filesystem = self.make_rebaseliner("")
307
        rebaseliner, filesystem = self.make_rebaseliner("")
Lines 331-337 class TestRealMain(unittest.TestCase): a/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py_sec5
331
        zip_factory = test_zip_factory()
336
        zip_factory = test_zip_factory()
332
337
333
        # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently.
338
        # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently.
334
        filesystem.chdir("/test.checkout")
339
        filesystem.chdir(filesystem.dirname(host_port_obj.layout_tests_dir()))
335
340
336
        oc = outputcapture.OutputCapture()
341
        oc = outputcapture.OutputCapture()
337
        oc.capture_output()
342
        oc.capture_output()

Return to Bug 75884