[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

eric at webkit.org eric at webkit.org
Fri Feb 26 22:21:20 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit cdf49fa17bdd7d57ec811c1879a80adf7ef9c626
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 16 22:21:44 2010 +0000

    2010-02-16  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            re-factor Skipped list parsing code into multiple functions and unit test it
            https://bugs.webkit.org/show_bug.cgi?id=34986
    
            * Scripts/test-webkitpy: Add new unit test.
            * Scripts/webkitpy/layout_tests/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
            * Scripts/webkitpy/layout_tests/port/mac.py: Split parsing function into multiple functions for testing.
            * Scripts/webkitpy/layout_tests/port/mac_unittest.py: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54830 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 4f79559..6cff882 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2010-02-16  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        re-factor Skipped list parsing code into multiple functions and unit test it
+        https://bugs.webkit.org/show_bug.cgi?id=34986
+
+        * Scripts/test-webkitpy: Add new unit test.
+        * Scripts/webkitpy/layout_tests/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+        * Scripts/webkitpy/layout_tests/port/mac.py: Split parsing function into multiple functions for testing.
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py: Added.
+
 2010-02-16  Xan Lopez  <xlopez at igalia.com>
 
         Reviewed by Gustavo Noronha.
diff --git a/WebKitTools/Scripts/test-webkitpy b/WebKitTools/Scripts/test-webkitpy
index cfd3434..8617330 100755
--- a/WebKitTools/Scripts/test-webkitpy
+++ b/WebKitTools/Scripts/test-webkitpy
@@ -44,6 +44,7 @@ from webkitpy.credentials_unittest import *
 from webkitpy.diff_parser_unittest import *
 from webkitpy.executive_unittest import *
 from webkitpy.grammar_unittest import *
+from webkitpy.layout_tests.port.mac_unittest import *
 from webkitpy.multicommandtool_unittest import *
 from webkitpy.networktransaction_unittest import *
 from webkitpy.patchcollection_unittest import *
diff --git a/WebKitTools/QueueStatusServer/filters/__init__.py b/WebKitTools/Scripts/webkitpy/layout_tests/__init__.py
similarity index 100%
copy from WebKitTools/QueueStatusServer/filters/__init__.py
copy to WebKitTools/Scripts/webkitpy/layout_tests/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
index 1e57cd2..58012f8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
@@ -103,8 +103,67 @@ class MacPort(base.Port):
         # to return something.
         return ('mac',)
 
+    def _skipped_file_paths(self):
+        # This method will need to be made work for non-mac platforms and moved into base.Port.
+        skipped_files = []
+        if self._name in ('mac-tiger', 'mac-leopard', 'mac-snowleopard'):
+            skipped_files.append(os.path.join(
+                self._webkit_baseline_path(self._name), 'Skipped'))
+        skipped_files.append(os.path.join(self._webkit_baseline_path('mac'),
+                                          'Skipped'))
+        return skipped_files
+
+    def _tests_for_other_platforms(self):
+        # The original run-webkit-tests builds up a "whitelist" of tests to run, and passes that to DumpRenderTree.
+        # run-chromium-webkit-tests assumes we run *all* tests and test_expectations.txt functions as a blacklist.
+        # FIXME: This list could be dynamic based on platform name and pushed into base.Port.
+        return [
+            "platform/chromium",
+            "platform/gtk",
+            "platform/qt",
+            "platform/win",
+        ]
+
+    def _tests_for_disabled_features(self):
+        # FIXME: This should use the feature detection from webkitperl/features.pm to match run-webkit-tests.
+        # For now we hard-code a list of features known to be disabled on the Mac platform.
+        disabled_feature_tests = [
+            "fast/xhtmlmp",
+            "http/tests/wml",
+            "mathml",
+            "wml",
+        ]
+        # FIXME: webarchive tests expect to read-write from -expected.webarchive files instead of .txt files.
+        # This script doesn't know how to do that yet, so pretend they're just "disabled".
+        webarchive_tests = [
+            "webarchive",
+            "svg/webarchive",
+            "http/tests/webarchive",
+            "svg/custom/image-with-prefix-in-webarchive.svg",
+        ]
+        return disabled_feature_tests + webarchive_tests
+
+    def _tests_from_skipped_file(self, skipped_file):
+        tests_to_skip = []
+        for line in skipped_file.readlines():
+            line = line.strip()
+            if line.startswith('#') or not len(line):
+                continue
+            tests_to_skip.append(line)
+        return tests_to_skip
+
+    def _expectations_from_skipped_files(self):
+        tests_to_skip = []
+        for filename in self._skipped_file_paths():
+            if not os.path.exists(filename):
+                logging.warn("Failed to open Skipped file: %s" % filename)
+                continue
+            skipped_file = file(filename)
+            tests_to_skip.extend(self._tests_from_skipped_file(skipped_file))
+            skipped_file.close()
+        return tests_to_skip
+
     def test_expectations(self):
-        #
         # The WebKit mac port uses 'Skipped' files at the moment. Each
         # file contains a list of files or directories to be skipped during
         # the test run. The total list of tests to skipped is given by the
@@ -112,44 +171,11 @@ class MacPort(base.Port):
         # a version-specific file found in platform/X-version. Duplicate
         # entries are allowed. This routine reads those files and turns
         # contents into the format expected by test_expectations.
-        expectations = []
-        skipped_files = []
-        if self._name in ('mac-tiger', 'mac-leopard', 'mac-snowleopard'):
-            skipped_files.append(os.path.join(
-                self._webkit_baseline_path(self._name), 'Skipped'))
-        skipped_files.append(os.path.join(self._webkit_baseline_path('mac'),
-                                          'Skipped'))
-        for filename in skipped_files:
-            if os.path.exists(filename):
-                f = file(filename)
-                for l in f.readlines():
-                    l = l.strip()
-                    if not l.startswith('#') and len(l):
-                        l = 'BUG_SKIPPED SKIP : ' + l + ' = FAIL'
-                        if l not in expectations:
-                            expectations.append(l)
-                f.close()
-
-        # TODO - figure out how to check for these dynamically
-        expectations.append('BUG_SKIPPED SKIP : fast/wcss = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : fast/xhtmlmp = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : http/tests/wml = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : mathml = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : platform/chromium = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : platform/gtk = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : platform/qt = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : platform/win = FAIL')
-        expectations.append('BUG_SKIPPED SKIP : wml = FAIL')
-
-        # TODO - figure out how to handle webarchive tests
-        expectations.append('BUG_SKIPPED SKIP : webarchive = PASS')
-        expectations.append('BUG_SKIPPED SKIP : svg/webarchive = PASS')
-        expectations.append('BUG_SKIPPED SKIP : http/tests/webarchive = PASS')
-        expectations.append('BUG_SKIPPED SKIP : svg/custom/'
-                            'image-with-prefix-in-webarchive.svg = PASS')
-
-        expectations_str = '\n'.join(expectations)
-        return expectations_str
+        tests_to_skip = set(self._expectations_from_skipped_files()) # Use a set to allow duplicates
+        tests_to_skip.update(self._tests_for_other_platforms())
+        tests_to_skip.update(self._tests_for_disabled_features())
+        expectations = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" % test_path, tests_to_skip)
+        return "\n".join(expectations)
 
     def test_platform_name(self):
         # At the moment we don't use test platform names, but we have
@@ -390,7 +416,6 @@ class MacDriver(base.Driver):
 
         return (crash, timeout, actual_image_hash,
                 ''.join(output), ''.join(error))
-        pass
 
     def stop(self):
         if self._proc:
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
new file mode 100644
index 0000000..e47a4a4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
@@ -0,0 +1,66 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#    * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#    * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#    * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+import mac
+import StringIO
+
+class MacTest(unittest.TestCase):
+
+    def test_skipped_file_paths(self):
+        port = mac.MacPort()
+        skipped_paths = port._skipped_file_paths()
+        # FIXME: _skipped_file_paths should return WebKit-relative paths.
+        # So to make it unit testable, we strip the WebKit directory from the path.
+        relative_paths = [path[len(port.path_from_webkit_base()):] for path in skipped_paths]
+        self.assertEqual(relative_paths, ['LayoutTests/platform/mac-leopard/Skipped', 'LayoutTests/platform/mac/Skipped'])
+
+    example_skipped_file = """
+# <rdar://problem/5647952> fast/events/mouseout-on-window.html needs mac DRT to issue mouse out events
+fast/events/mouseout-on-window.html
+
+# <rdar://problem/5643675> window.scrollTo scrolls a window with no scrollbars
+fast/events/attempt-scroll-with-no-scrollbars.html
+
+# see bug <rdar://problem/5646437> REGRESSION (r28015): svg/batik/text/smallFonts fails
+svg/batik/text/smallFonts.svg
+"""
+    example_skipped_tests = [
+        "fast/events/mouseout-on-window.html",
+        "fast/events/attempt-scroll-with-no-scrollbars.html",
+        "svg/batik/text/smallFonts.svg",
+    ]
+
+    def test_skipped_file_paths(self):
+        port = mac.MacPort()
+        skipped_file = StringIO.StringIO(self.example_skipped_file)
+        self.assertEqual(port._tests_from_skipped_file(skipped_file), self.example_skipped_tests)
+
+
+if __name__ == '__main__':
+    unittest.main()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list