Title: [104524] trunk/Tools
Revision
104524
Author
[email protected]
Date
2012-01-09 17:32:54 -0800 (Mon, 09 Jan 2012)

Log Message

webkitpy.layout_tests.port.mock_drt_unittest.MockChromiumDRTTest has been failing on cr-win
https://bugs.webkit.org/show_bug.cgi?id=75884

Reviewed by Ryosuke Niwa.

Fix regression introduced (revealed?) in r104340. Chromium file
url syntax is different on win32 and the test results weren't
expecting that.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectations._report_errors):
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
(test_parse_error_nonfatal):
* Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py:
(MockDRTTest.input_line):
(MockChromiumDRTTest.test_pixeltest__fails):
* Scripts/webkitpy/layout_tests/port/test.py:
* Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py:
(TestRebaseliner.make_rebaseliner):
(TestRebaseliner.test_one_platform):
(TestRebaseliner.test_all_platforms):
(TestRebaseliner.test_png_file_with_comment):
(TestRebaseliner.test_png_file_with_comment_remove_old_checksum):
(TestRebaseliner.test_png_file_with_comment_as_duplicate):
(TestRealMain.test_all_platforms):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (104523 => 104524)


--- trunk/Tools/ChangeLog	2012-01-10 01:24:13 UTC (rev 104523)
+++ trunk/Tools/ChangeLog	2012-01-10 01:32:54 UTC (rev 104524)
@@ -1,5 +1,33 @@
 2012-01-09  Dirk Pranke  <[email protected]>
 
+        webkitpy.layout_tests.port.mock_drt_unittest.MockChromiumDRTTest has been failing on cr-win
+        https://bugs.webkit.org/show_bug.cgi?id=75884
+
+        Reviewed by Ryosuke Niwa.
+
+        Fix regression introduced (revealed?) in r104340. Chromium file         
+        url syntax is different on win32 and the test results weren't           
+        expecting that.                                                         
+
+        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
+        (TestExpectations._report_errors):
+        * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
+        (test_parse_error_nonfatal):
+        * Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py:
+        (MockDRTTest.input_line):
+        (MockChromiumDRTTest.test_pixeltest__fails):
+        * Scripts/webkitpy/layout_tests/port/test.py:
+        * Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py:
+        (TestRebaseliner.make_rebaseliner):
+        (TestRebaseliner.test_one_platform):
+        (TestRebaseliner.test_all_platforms):
+        (TestRebaseliner.test_png_file_with_comment):
+        (TestRebaseliner.test_png_file_with_comment_remove_old_checksum):
+        (TestRebaseliner.test_png_file_with_comment_as_duplicate):
+        (TestRealMain.test_all_platforms):
+
+2012-01-09  Dirk Pranke  <[email protected]>
+
         Fix regression in test-webkitpy introduced by removing the webkitpy/python24 directory.
 
         Unreviewed, build fix.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py (104523 => 104524)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2012-01-10 01:24:13 UTC (rev 104523)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2012-01-10 01:32:54 UTC (rev 104524)
@@ -789,10 +789,8 @@
             warnings.append(warning)
 
         if len(errors) or len(warnings):
-            webkit_base_path = self._port.webkit_base()
             test_expectation_path = self._port.path_to_test_expectations_file()
-            test_expectation_relative_path = test_expectation_path[len(webkit_base_path):].lstrip('/')
-            failure_title = "FAILURES FOR %s in %s" % (str(self._test_config), test_expectation_relative_path)
+            failure_title = "FAILURES FOR %s in %s" % (str(self._test_config), test_expectation_path)
             _log.error(failure_title)
 
             for error in errors:

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py (104523 => 104524)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2012-01-10 01:24:13 UTC (rev 104523)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py	2012-01-10 01:32:54 UTC (rev 104524)
@@ -199,7 +199,7 @@
             self.assertFalse(True, "ParseError wasn't raised")
         except ParseError, e:
             self.assertTrue(e.fatal)
-            exp_errors = [u"FAILURES FOR %s in LayoutTests/platform/test/test_expectations.txt" % self._port.test_configuration(),
+            exp_errors = [u"FAILURES FOR %s in %s" % (self._port.test_configuration(), self._port.path_to_test_expectations_file()),
                           u"Line:1 Unrecognized modifier 'foo' failures/expected/text.html",
                           u"Line:2 Missing expectations SKIP : failures/expected/image.html"]
             self.assertEqual(str(e), '\n'.join(map(str, exp_errors)))
@@ -212,7 +212,7 @@
             self.assertFalse(True, "ParseError wasn't raised")
         except ParseError, e:
             self.assertFalse(e.fatal)
-            exp_errors = [u'FAILURES FOR %s in LayoutTests/platform/test/test_expectations.txt' % self._port.test_configuration(),
+            exp_errors = [u'FAILURES FOR %s in %s' % (self._port.test_configuration(), self._port.path_to_test_expectations_file()),
                           u'Line:1 Test lacks BUG modifier. failures/expected/text.html']
             self.assertEqual(str(e), '\n'.join(map(str, exp_errors)))
             self.assertEqual(e.errors, exp_errors)

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py (104523 => 104524)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py	2012-01-10 01:24:13 UTC (rev 104523)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py	2012-01-10 01:32:54 UTC (rev 104524)
@@ -90,12 +90,11 @@
 class MockDRTTest(unittest.TestCase):
     def input_line(self, port, test_name, checksum=None):
         url = ""
-        # FIXME: we shouldn't have to work around platform-specific issues
-        # here.
-        if url.startswith('file:////'):
-            url = "" - 1:]
-        if url.startswith('file:///'):
-            url = "" - 1:]
+        if url.startswith('file://'):
+            if sys.platform == 'win32':
+                url = ""
+            else:
+                url = ""
 
         if checksum:
             return url + "'" + checksum + '\n'
@@ -236,9 +235,10 @@
 
     def test_pixeltest__fails(self):
         host = MockHost()
+        url = '' % host.port_factory.get('test').layout_tests_dir()
         self.assertTest('failures/expected/checksum.html', pixel_tests=True,
             expected_checksum='wrong-checksum',
-            drt_output=['#URL:file:///test.checkout/LayoutTests/failures/expected/checksum.html\n',
+            drt_output=[url + '\n',
                         '#MD5:checksum-checksum\n',
                         'checksum-txt',
                         '\n',

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py (104523 => 104524)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py	2012-01-10 01:24:13 UTC (rev 104523)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/test.py	2012-01-10 01:32:54 UTC (rev 104524)
@@ -31,6 +31,7 @@
 from __future__ import with_statement
 
 import base64
+import sys
 import time
 
 from webkitpy.layout_tests.port import Port, Driver, DriverOutput
@@ -220,7 +221,10 @@
 # this works. The path contains a '.' in the name because we've seen bugs
 # related to this before.
 
-LAYOUT_TEST_DIR = '/test.checkout/LayoutTests'
+if sys.platform == 'win32':
+    LAYOUT_TEST_DIR = 'c:/test.checkout/LayoutTests'
+else:
+    LAYOUT_TEST_DIR = '/test.checkout/LayoutTests'
 
 
 # Here we synthesize an in-memory filesystem from the test list

Modified: trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py (104523 => 104524)


--- trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py	2012-01-10 01:24:13 UTC (rev 104523)
+++ trunk/Tools/Scripts/webkitpy/to_be_moved/rebaseline_chromium_webkit_tests_unittest.py	2012-01-10 01:32:54 UTC (rev 104524)
@@ -195,7 +195,7 @@
         zip_factory = test_zip_factory()
 
         # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently.
-        filesystem.chdir("/test.checkout")
+        filesystem.chdir(filesystem.dirname(host_port_obj.layout_tests_dir()))
 
         rebaseliner = rebaseline_chromium_webkit_tests.Rebaseliner(host, host_port_obj,
             target_port_obj, platform, options, url_fetcher, zip_factory)
@@ -227,34 +227,37 @@
             "BUGX REBASELINE MAC : failures/expected/image.html = IMAGE")
 
         rebaseliner.run()
+        layout_test_dir = rebaseliner._port.layout_tests_dir()
         # We expect to have written 13 files over the course of this rebaseline:
         # *) 3 files in /__im_tmp for the extracted archive members
-        # *) 3 new baselines under '/test.checkout/LayoutTests'
+        # *) 3 new baselines under layout_test_dir
         # *) 4 files in /tmp for the new and old baselines in the result file
         #    (-{old,new}.{txt,png}
         # *) 1 text diff in /tmp for the result file (-diff.txt).
         # *) 1 image diff in /tmp for the result file (-diff.png).
         # *) 1 updated test_expectations file
         self.assertEqual(len(filesystem.written_files), 13)
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
 
     def test_all_platforms(self):
         rebaseliner, filesystem = self.make_rebaseliner(
             "BUGX REBASELINE : failures/expected/image.html = IMAGE")
+        layout_test_dir = rebaseliner._port.layout_tests_dir()
         rebaseliner.run()
         # See comment in test_one_platform for an explanation of the 13 written tests.
         # Note that even though the rebaseline is marked for all platforms, each
         # rebaseliner only ever does one.
         self.assertEqual(len(filesystem.written_files), 13)
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.checksum'], 'new-image-checksum')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.png'], 'new-image-png')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image-expected.txt'], 'new-image-txt')
 
     def test_png_file_with_comment(self):
         rebaseliner, filesystem = self.make_rebaseliner(
             "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
+        layout_test_dir = rebaseliner._port.layout_tests_dir()
         compile_success = rebaseliner._compile_rebaselining_tests()
         self.assertTrue(compile_success)
         self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests)
@@ -262,16 +265,17 @@
         # There is one less file written than |test_one_platform| because we only
         # write 2 expectations (the png and the txt file).
         self.assertEqual(len(filesystem.written_files), 12)
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
-        self.assertFalse(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None))
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
+        self.assertFalse(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None))
 
     def test_png_file_with_comment_remove_old_checksum(self):
         rebaseliner, filesystem = self.make_rebaseliner(
             "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
-        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'] = 'old'
-        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum'] = 'old'
-        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'] = 'old'
+        layout_test_dir = rebaseliner._port.layout_tests_dir()
+        filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'] = 'old'
+        filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum'] = 'old'
+        filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'] = 'old'
 
         compile_success = rebaseliner._compile_rebaselining_tests()
         self.assertTrue(compile_success)
@@ -280,23 +284,24 @@
         # There is one more file written than |test_png_file_with_comment_remove_old_checksum|
         # because we also delete the old checksum.
         self.assertEqual(len(filesystem.written_files), 13)
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
-        self.assertEqual(filesystem.files['/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
-        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png'], 'tEXtchecksum\x000123456789')
+        self.assertEqual(filesystem.files[layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt'], 'png-comment-txt')
+        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
 
     def test_png_file_with_comment_as_duplicate(self):
         rebaseliner, filesystem = self.make_rebaseliner(
             "BUGX REBASELINE MAC : failures/expected/image_checksum.html = IMAGE")
-        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.png'] = 'tEXtchecksum\x000123456789'
-        filesystem.files['/test.checkout/LayoutTests/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.txt'] = 'png-comment-txt'
+        layout_test_dir = rebaseliner._port.layout_tests_dir()
+        filesystem.files[layout_test_dir + '/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.png'] = 'tEXtchecksum\x000123456789'
+        filesystem.files[layout_test_dir + '/platform/test-mac-snowleopard/failures/expected/image_checksum-expected.txt'] = 'png-comment-txt'
 
         compile_success = rebaseliner._compile_rebaselining_tests()
         self.assertTrue(compile_success)
         self.assertEqual(set(['failures/expected/image_checksum.html']), rebaseliner._rebaselining_tests)
         rebaseliner.run()
-        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.png', None), None)
-        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt', None), None)
-        self.assertEqual(filesystem.files.get('/test.checkout/LayoutTests/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
+        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.png', None), None)
+        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.txt', None), None)
+        self.assertEqual(filesystem.files.get(layout_test_dir + '/platform/test-mac-leopard/failures/expected/image_checksum-expected.checksum', None), None)
 
     def test_diff_baselines_txt(self):
         rebaseliner, filesystem = self.make_rebaseliner("")
@@ -331,7 +336,7 @@
         zip_factory = test_zip_factory()
 
         # FIXME: SCM module doesn't handle paths that aren't relative to the checkout_root consistently.
-        filesystem.chdir("/test.checkout")
+        filesystem.chdir(filesystem.dirname(host_port_obj.layout_tests_dir()))
 
         oc = outputcapture.OutputCapture()
         oc.capture_output()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to