Title: [90076] trunk/Tools
Revision
90076
Author
[email protected]
Date
2011-06-29 18:11:42 -0700 (Wed, 29 Jun 2011)

Log Message

2011-06-29  Sheriff Bot  <[email protected]>

        Unreviewed, rolling out r90070.
        http://trac.webkit.org/changeset/90070
        https://bugs.webkit.org/show_bug.cgi?id=63676

        Broke test-webkitpy rebaseline tests (Requested by eseidel2 on
        #webkit).

        * Scripts/webkitpy/layout_tests/port/base.py:
        * Scripts/webkitpy/layout_tests/port/chromium.py:
        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
        * Scripts/webkitpy/layout_tests/port/gtk.py:
        * Scripts/webkitpy/layout_tests/port/mac.py:
        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
        * Scripts/webkitpy/layout_tests/port/qt.py:
        * Scripts/webkitpy/layout_tests/port/webkit.py:
        * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
        * Scripts/webkitpy/layout_tests/port/win.py:
        * Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (90075 => 90076)


--- trunk/Tools/ChangeLog	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/ChangeLog	2011-06-30 01:11:42 UTC (rev 90076)
@@ -1,3 +1,26 @@
+2011-06-29  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r90070.
+        http://trac.webkit.org/changeset/90070
+        https://bugs.webkit.org/show_bug.cgi?id=63676
+
+        Broke test-webkitpy rebaseline tests (Requested by eseidel2 on
+        #webkit).
+
+        * Scripts/webkitpy/layout_tests/port/base.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+        * Scripts/webkitpy/layout_tests/port/gtk.py:
+        * Scripts/webkitpy/layout_tests/port/mac.py:
+        * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+        * Scripts/webkitpy/layout_tests/port/qt.py:
+        * Scripts/webkitpy/layout_tests/port/webkit.py:
+        * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
+        * Scripts/webkitpy/layout_tests/port/win.py:
+        * Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py:
+
 2011-06-29  Adam Barth  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -66,8 +66,11 @@
 
 
 class DummyOptions(object):
-    """Fake implementation of optparse.Values. Cloned from webkitpy.tool.mocktool.MockOptions."""
+    """Fake implementation of optparse.Values. Cloned from
+    webkitpy.tool.mocktool.MockOptions.
 
+    """
+
     def __init__(self, **kwargs):
         # The caller can set option values using keyword arguments. We don't
         # set any values by default because we don't know how this
@@ -78,21 +81,20 @@
             self.__dict__[key] = value
 
 
-# FIXME: This class should merge with webkitpy.common.config.ports.
+# FIXME: This class should merge with webkitpy.webkit_port at some point.
 class Port(object):
     """Abstract class for Port-specific hooks for the layout_test package."""
 
-    port_name = None  # Subclasses override this
-
     def __init__(self, port_name=None, options=None,
                  executive=None,
                  user=None,
                  filesystem=None,
                  config=None,
                  **kwargs):
+        self._name = port_name
 
         # These are default values that should be overridden in a subclasses.
-        self._name = port_name or self.port_name  # Subclasses may append a -VERSION (like mac-leopard) or other qualifiers.
+        # FIXME: These should really be passed in.
         self._operating_system = 'mac'
         self._version = ''
         self._architecture = 'x86'
@@ -110,8 +112,9 @@
 
         self._helper = None
         self._http_server = None
+        self._webkit_base_dir = None
         self._websocket_server = None
-        self._http_lock = None  # FIXME: Why does this live on the port object?
+        self._http_lock = None
 
         # Python's Popen has a bug that causes any pipes opened to a
         # process that can't be executed to be leaked.  Since this
@@ -129,11 +132,12 @@
         self._wdiff_available = None
 
         # FIXME: prettypatch.py knows this path, why is it copied here?
-        self._pretty_patch_path = self.path_from_webkit_base("Websites", "bugs.webkit.org", "PrettyPatch", "prettify.rb")
+        self._pretty_patch_path = self.path_from_webkit_base("Websites",
+            "bugs.webkit.org", "PrettyPatch", "prettify.rb")
         self._pretty_patch_available = None
 
         self.set_option_default('configuration', self.default_configuration())
-        self._test_configuration = None  # FIXME: This does not belong on the real object.
+        self._test_configuration = None
         self._multiprocessing_is_available = (multiprocessing is not None)
         self._results_directory = None
         self.set_option_default('use_apache', self._default_to_apache())
@@ -149,7 +153,8 @@
         return self._pretty_patch_available
 
     def default_child_processes(self):
-        """Return the number of DumpRenderTree instances to use for this port."""
+        """Return the number of DumpRenderTree instances to use for this
+        port."""
         return self._executive.cpu_count()
 
     def default_worker_model(self):
@@ -158,8 +163,10 @@
         return 'threads'
 
     def baseline_path(self):
-        """Return the absolute path to the directory to store new baselines in for this port."""
-        baseline_search_paths = self.get_option('additional_platform_directory', []) + self.baseline_search_path()
+        """Return the absolute path to the directory to store new baselines
+        in for this port."""
+        baseline_search_paths = \
+            self.get_option('additional_platform_directory', []) + self.baseline_search_path()
         return baseline_search_paths[0]
 
     def baseline_search_path(self):
@@ -240,11 +247,11 @@
         return expected_text != actual_text
 
     def compare_audio(self, expected_audio, actual_audio):
-        # FIXME: If we give this method a better name it won't need this docstring (e.g. are_audio_results_equal()).
         """Return whether the two audio files are *not* equal."""
         return expected_audio != actual_audio
 
-    def diff_image(self, expected_contents, actual_contents, diff_filename=None, tolerance=0):
+    def diff_image(self, expected_contents, actual_contents,
+                   diff_filename=None, tolerance=0):
         """Compare two images and produce a delta image file.
 
         Return True if the two images are different, False if they are the same.
@@ -326,7 +333,8 @@
 
         baselines = []
         for platform_dir in baseline_search_path:
-            if self.path_exists(self._filesystem.join(platform_dir, baseline_filename)):
+            if self.path_exists(self._filesystem.join(platform_dir,
+                                                      baseline_filename)):
                 baselines.append((platform_dir, baseline_filename))
 
             if not all_baselines and baselines:
@@ -363,8 +371,8 @@
         This routine is generic but is implemented here to live alongside
         the other baseline and filename manipulation routines.
         """
-        # FIXME: The [0] here is very mysterious, as is the destructured return.
-        platform_dir, baseline_filename = self.expected_baselines(filename, suffix)[0]
+        platform_dir, baseline_filename = self.expected_baselines(
+            filename, suffix)[0]
         if platform_dir:
             return self._filesystem.join(platform_dir, baseline_filename)
         return self._filesystem.join(self.layout_tests_dir(), baseline_filename)
@@ -448,7 +456,9 @@
         return test_files.find(self, paths)
 
     def test_dirs(self):
-        """Returns the list of top-level test directories."""
+        """Returns the list of top-level test directories.
+
+        Used by --clobber-old-results."""
         layout_tests_dir = self.layout_tests_dir()
         return filter(lambda x: self._filesystem.isdir(self._filesystem.join(layout_tests_dir, x)),
                       self._filesystem.listdir(layout_tests_dir))
@@ -529,16 +539,9 @@
         self._filesystem.maybe_make_directory(*path)
 
     def name(self):
-        """Returns a name that uniquely identifies this particular type of port
-        (e.g., "mac-snowleopard" or "chromium-gpu-linux-x86_x64" and can be passed
-        to factory.get() to instantiate the port."""
+        """Return the name of the port (e.g., 'mac', 'chromium-win-xp')."""
         return self._name
 
-    def real_name(self):
-        # FIXME: Seems this is only used for MockDRT and should be removed.
-        """Returns the name of the port as passed to the --platform command line argument."""
-        return self.name()
-
     def operating_system(self):
         return self._operating_system
 
@@ -565,6 +568,10 @@
     def architecture(self):
         return self._architecture
 
+    def real_name(self):
+        """Returns the actual name of the port, not the delegate's."""
+        return self.name()
+
     def get_option(self, name, default_value=None):
         # FIXME: Eventually we should not have to do a test for
         # hasattr(), and we should be able to just do
@@ -634,7 +641,8 @@
         return self._user.open_url(results_filename)
 
     def create_driver(self, worker_number):
-        """Return a newly created base.Driver subclass for starting/stopping the test driver."""
+        """Return a newly created base.Driver subclass for starting/stopping
+        the test driver."""
         raise NotImplementedError('Port.create_driver')
 
     def start_helper(self):
@@ -868,7 +876,8 @@
         raise NotImplementedError('Port._path_to_helper')
 
     def _path_to_image_diff(self):
-        """Returns the full path to the image_diff binary, or None if it is not available.
+        """Returns the full path to the image_diff binary, or None if it
+        is not available.
 
         This is likely used only by diff_image()"""
         raise NotImplementedError('Port.path_to_image_diff')

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -53,11 +53,9 @@
 _log = logging.getLogger("webkitpy.layout_tests.port.chromium")
 
 
+# FIXME: This function doesn't belong in this package.
 class ChromiumPort(base.Port):
     """Abstract base class for Chromium implementations of the Port class."""
-
-    port_name = "chromium"
-
     ALL_BASELINE_VARIANTS = [
         'chromium-mac-snowleopard', 'chromium-mac-leopard',
         'chromium-win-win7', 'chromium-win-vista', 'chromium-win-xp',
@@ -348,6 +346,8 @@
 
 
 class ChromiumDriver(base.Driver):
+    """Abstract interface for DRT."""
+
     def __init__(self, port, worker_number):
         self._port = port
         self._worker_number = worker_number

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -48,6 +48,7 @@
     def __init__(self, port_name=None, **kwargs):
         port_name = port_name or 'chromium-linux'
         chromium.ChromiumPort.__init__(self, port_name=port_name, **kwargs)
+
         # We re-set the port name once the base object is fully initialized
         # in order to be able to find the DRT binary properly.
         if port_name.endswith('-linux'):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -76,7 +76,7 @@
             self._version = mac.os_version(os_version_string, self.SUPPORTED_OS_VERSIONS)
             self._name = port_name + '-' + self._version
         else:
-            self._version = port_name[port_name.index('-mac-') + len('-mac-'):]
+            self._version = port_name[port_name.index('-mac-') + 5:]
             assert self._version in self.SUPPORTED_OS_VERSIONS
         self._operating_system = 'mac'
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -74,8 +74,9 @@
             self._version = os_version(windows_version)
             self._name = port_name + '-' + self._version
         else:
-            self._version = port_name[port_name.index('-win-') + len('-win-'):]
-            assert self._version in self.SUPPORTED_VERSIONS, "%s is not in %s" % (self._version, self.SUPPORTED_VERSIONS)
+            self._version = port_name[port_name.index('-win-') + 5:]
+            assert self._version in self.SUPPORTED_VERSIONS
+
         self._operating_system = 'win'
 
     def setup_environ_for_server(self):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -39,6 +39,8 @@
 
 
 class GtkDriver(webkit.WebKitDriver):
+    """WebKit Gtk implementation of the Driver class."""
+
     def start(self):
         display_id = self._worker_number + 1
         run_xvfb = ["Xvfb", ":%d" % (display_id)]
@@ -55,20 +57,27 @@
 
 
 class GtkPort(webkit.WebKitPort):
-    port_name = "gtk"
+    """WebKit Gtk implementation of the Port class."""
 
+    def __init__(self, **kwargs):
+        kwargs.setdefault('port_name', 'gtk')
+        webkit.WebKitPort.__init__(self, **kwargs)
+
     def create_driver(self, worker_number):
         return GtkDriver(self, worker_number)
 
     def _path_to_apache_config_file(self):
         # FIXME: This needs to detect the distribution and change config files.
-        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-debian-httpd.conf')
+        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
+                                     'apache2-debian-httpd.conf')
 
     def _path_to_driver(self):
         return self._build_path('Programs', self.driver_name())
 
     def check_build(self, needs_http):
-        return self._check_driver()
+        if not self._check_driver():
+            return False
+        return True
 
     def _path_to_apache(self):
         if self._is_redhat_based():
@@ -82,7 +91,8 @@
         else:
             config_name = 'apache2-debian-httpd.conf'
 
-        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_name)
+        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
+                            config_name)
 
     def _path_to_wdiff(self):
         if self._is_redhat_based():
@@ -105,5 +115,7 @@
             if os.path.isfile(full_library):
                 return full_library
 
+        return None
+
     def _runtime_feature_list(self):
         return None

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -48,7 +48,6 @@
     version_strings = {
         5: 'leopard',
         6: 'snowleopard',
-        # Add 7: 'lion' here?
     }
     assert release_version >= min(version_strings.keys())
     version_string = version_strings.get(release_version, 'future')
@@ -58,8 +57,7 @@
 
 
 class MacPort(WebKitPort):
-    port_name = "mac"
-
+    """WebKit Mac implementation of the Port class."""
     # FIXME: 'wk2' probably shouldn't be a version, it should probably be
     # a modifier, like 'chromium-gpu' is to 'chromium'.
     SUPPORTED_VERSIONS = ('leopard', 'snowleopard', 'future', 'wk2')
@@ -68,7 +66,6 @@
         'leopard': ['mac-leopard', 'mac-snowleopard', 'mac'],
         'snowleopard': ['mac-snowleopard', 'mac'],
         'future': ['mac'],
-        # FIXME: This isn't quite right for wk2, it should include mac-VERSION as well.
         'wk2': ['mac-wk2', 'mac'],
     }
 
@@ -79,9 +76,8 @@
             self._version = os_version(os_version_string)
             self._name = port_name + '-' + self._version
         else:
-            assert port_name.startswith('mac')
-            self._version = port_name[len('mac-'):]
-            assert self._version in self.SUPPORTED_VERSIONS, "%s is not in %s" % (self._version, self.SUPPORTED_VERSIONS)
+            self._version = port_name[4:]
+            assert self._version in self.SUPPORTED_VERSIONS
         self._operating_system = 'mac'
         if not hasattr(self._options, 'time-out-ms') or self._options.time_out_ms is None:
             self._options.time_out_ms = 35000
@@ -98,9 +94,24 @@
     def baseline_search_path(self):
         return map(self._webkit_baseline_path, self.FALLBACK_PATHS[self._version])
 
+    def path_to_test_expectations_file(self):
+        return self.path_from_webkit_base('LayoutTests', 'platform',
+           'mac', 'test_expectations.txt')
+
     def is_crash_reporter(self, process_name):
         return re.search(r'ReportCrash', process_name)
 
+    def _skipped_file_paths(self):
+        # FIXME: This method will need to be made work for non-mac
+        # platforms and moved into base.Port.
+        skipped_files = []
+        if self._name in ('mac-leopard', 'mac-snowleopard'):
+            skipped_files.append(self._filesystem.join(
+                self._webkit_baseline_path(self._name), 'Skipped'))
+        skipped_files.append(self._filesystem.join(self._webkit_baseline_path('mac'),
+                                          'Skipped'))
+        return skipped_files
+
     def _build_java_test_support(self):
         java_tests_path = self._filesystem.join(self.layout_tests_dir(), "java")
         build_java = ["/usr/bin/make", "-C", java_tests_path]
@@ -113,7 +124,8 @@
         return self._build_java_test_support()
 
     def _path_to_apache_config_file(self):
-        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-httpd.conf')
+        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
+                                     'apache2-httpd.conf')
 
     def _path_to_webcore_library(self):
         return self._build_path('WebCore.framework/Versions/A/WebCore')

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -40,21 +40,25 @@
             return None
         return mac.MacPort
 
-    def assert_skipped_file_search_paths(self, port_name, expected_paths):
+    def assert_skipped_files_for_version(self, port_name, expected_paths):
         port = mac.MacPort(port_name=port_name)
-        self.assertEqual(port._skipped_file_search_paths(), expected_paths)
+        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, expected_paths)
 
-    def test_skipped_file_search_paths(self):
-        # FIXME: This should no longer be necessary, but I'm not brave enough to remove it.
+    def test_skipped_file_paths(self):
+        # We skip this on win32 because we use '/' as the dir separator and it's
+        # not worth making platform-independent.
         if sys.platform == 'win32':
             return None
 
-        self.assert_skipped_file_search_paths('mac-snowleopard', set(['mac-snowleopard', 'mac']))
-        self.assert_skipped_file_search_paths('mac-leopard', set(['mac-leopard', 'mac']))
-        # We cannot test just "mac" here as the MacPort constructor automatically fills in the version from the running OS.
-        # self.assert_skipped_file_search_paths('mac', ['mac'])
+        self.assert_skipped_files_for_version('mac-snowleopard',
+            ['/LayoutTests/platform/mac-snowleopard/Skipped', '/LayoutTests/platform/mac/Skipped'])
+        self.assert_skipped_files_for_version('mac-leopard',
+            ['/LayoutTests/platform/mac-leopard/Skipped', '/LayoutTests/platform/mac/Skipped'])
 
-
     example_skipped_file = u"""
 # <rdar://problem/5647952> fast/events/mouseout-on-window.html needs mac DRT to issue mouse out events
 fast/events/mouseout-on-window.html

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -39,8 +39,12 @@
 
 
 class QtPort(WebKitPort):
-    port_name = "qt"
+    """QtWebKit implementation of the Port class."""
 
+    def __init__(self, **kwargs):
+        kwargs.setdefault('port_name', 'qt')
+        WebKitPort.__init__(self, **kwargs)
+
     def baseline_search_path(self):
         port_names = []
         if sys.platform.startswith('linux'):
@@ -54,7 +58,8 @@
 
     def _path_to_apache_config_file(self):
         # FIXME: This needs to detect the distribution and change config files.
-        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-debian-httpd.conf')
+        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
+                                     'apache2-debian-httpd.conf')
 
     def _build_driver(self):
         # The Qt port builds DRT as part of the main build step

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -36,20 +36,26 @@
 import operator
 import os
 import re
+import signal
+import sys
 import time
+import webbrowser
 
+
 from webkitpy.common.net.buildbot import BuildBot
+from webkitpy.common.system import ospath
 from webkitpy.common.system.executive import ScriptError
 from webkitpy.layout_tests.port import base, builders, server_process
 
+_log = logging.getLogger("webkitpy.layout_tests.port.webkit")
 
-_log = logging.getLogger(__file__)
 
-
 class WebKitPort(base.Port):
+    """WebKit implementation of the Port class."""
+
     def __init__(self, **kwargs):
         base.Port.__init__(self, **kwargs)
-        self._cached_apache_path = None  # FIXME: This class should use @memoized instead.
+        self._cached_apache_path = None
 
         # FIXME: disable pixel tests until they are run by default on the build machines.
         self.set_option_default("pixel_tests", False)
@@ -59,21 +65,12 @@
             return "WebKitTestRunner"
         return "DumpRenderTree"
 
-    # FIXME: This is not a very useful default implementation, as its wrong for any
-    # port which uses version-specific fallback (e.g. ['mac-leapard', 'mac']).
-    # We should replace this with a smarter implementation shared by all ports.
     def baseline_search_path(self):
-        search_paths = [self.name()]
-        if self.get_option('webkit_test_runner'):
-            search_paths.insert(0, self._wk2_port_name())
-        return search_paths
+        return [self._webkit_baseline_path(self._name)]
 
-    def _expectations_search_path(self):
-        # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name().
-        return self._wk2_port_name() if self.get_option('webkit_test_runner') else self.port_name
-
     def path_to_test_expectations_file(self):
-        return self._filesystem.join(self._webkit_baseline_path(self._expectations_search_path()), 'test_expectations.txt')
+        return self._filesystem.join(self._webkit_baseline_path(self._name),
+                                     'test_expectations.txt')
 
     def _results_for_platform(self, platform):
         builder_name = builders.builder_name_for_platform(platform)
@@ -287,26 +284,12 @@
             tests_to_skip.append(line)
         return tests_to_skip
 
-    def _wk2_port_name(self):
-        # By current convention, the WebKit2 name is always mac-wk2, win-wk2, not mac-leopard-wk2, etc.
-        return "%s-wk2" % self.port_name
+    def _skipped_file_paths(self):
+        return [self._filesystem.join(self._webkit_baseline_path(self._name), 'Skipped')]
 
-    def _skipped_file_search_paths(self):
-        # Unlike baseline_search_path, we only want to search [WK2-PORT, PORT-VERSION, PORT] not the full casade.
-        # Note order doesn't matter since the Skipped file contents are all combined.
-        search_paths = set([self.port_name, self.name()])
-        if self.get_option('webkit_test_runner'):
-            # Quoting old-run-webkit-tests:
-            # Because nearly all of the skipped tests for WebKit 2 on Mac are due to
-            # cross-platform issues, the Windows and Qt ports use the Mac skipped list
-            # additionally to their own to avoid maintaining separate lists.
-            search_paths.update([self._wk2_port_name(), "mac-wk2"])
-        return search_paths
-
     def _expectations_from_skipped_files(self):
         tests_to_skip = []
-        for search_path in self._skipped_file_search_paths():
-            filename = self._filesystem.join(self._webkit_baseline_path(search_path), "Skipped")
+        for filename in self._skipped_file_paths():
             if not self._filesystem.exists(filename):
                 _log.warn("Failed to open Skipped file: %s" % filename)
                 continue
@@ -315,14 +298,12 @@
         return tests_to_skip
 
     def test_expectations(self):
-        # This allows ports to use a combination of test_expectations.txt files and Skipped lists.
-        expectations = self._skipped_list_as_expectations()
+        # The WebKit mac port uses a combination of a test_expectations file
+        # and 'Skipped' files.
         expectations_path = self.path_to_test_expectations_file()
-        if self._filesystem.exists(expectations_path):
-            expectations = self._filesystem.read_text_file(expectations_path) + expectations
-        return expectations
+        return self._filesystem.read_text_file(expectations_path) + self._skips()
 
-    def _skipped_list_as_expectations(self):
+    def _skips(self):
         # Each Skipped 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 contents of the generic
@@ -332,7 +313,8 @@
         # format expected by test_expectations.
 
         tests_to_skip = self.skipped_layout_tests()
-        skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" % test_path, tests_to_skip)
+        skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" %
+                                test_path, tests_to_skip)
         return "\n".join(skip_lines)
 
     def skipped_layout_tests(self):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -37,8 +37,6 @@
 
 
 class TestWebKitPort(WebKitPort):
-    port_name = "testwebkitport"
-
     def __init__(self, symbol_list=None, feature_list=None,
                  expectations_file=None, skips_file=None,
                  executive=None, filesystem=None, user=None,
@@ -48,7 +46,7 @@
         executive = executive or MockExecutive(should_log=False)
         filesystem = filesystem or MockFileSystem()
         user = user or MockUser()
-        WebKitPort.__init__(self, executive=executive, filesystem=filesystem, user=MockUser(), **kwargs)
+        WebKitPort.__init__(self, port_name="testwebkitport", executive=executive, filesystem=filesystem, user=MockUser(), **kwargs)
 
     def _runtime_feature_list(self):
         return self.feature_list
@@ -91,14 +89,6 @@
     def test_skipped_layout_tests(self):
         self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(), set(["media"]))
 
-    def test_skipped_file_search_paths(self):
-        port = TestWebKitPort()
-        self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport']))
-        port._name = "testwebkitport-version"
-        self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport', 'testwebkitport-version']))
-        port._options = MockOptions(webkit_test_runner=True)
-        self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport', 'testwebkitport-version', 'testwebkitport-wk2', 'mac-wk2']))
-
     def test_test_expectations(self):
         # Check that we read both the expectations file and anything in a
         # Skipped file, and that we include the feature and platform checks.

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/win.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/win.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/win.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -32,21 +32,23 @@
 
 from webkitpy.layout_tests.port.webkit import WebKitPort
 
-_log = logging.getLogger(__file__)
+_log = logging.getLogger("webkitpy.layout_tests.port.win")
 
 
 class WinPort(WebKitPort):
-    port_name = "win"
+    """WebKit Win implementation of the Port class."""
 
-    def __init__(self, **kwargs):
-        WebKitPort.__init__(self, **kwargs)
+    def __init__(self, port_name=None, **kwargs):
+        port_name = port_name or 'win'
+        WebKitPort.__init__(self, port_name=port_name, **kwargs)
         self._version = 'win7'
         self._operating_system = 'win'
 
     def baseline_search_path(self):
         # Based on code from old-run-webkit-tests expectedDirectoryForTest()
-        search_paths = ["win", "mac-snowleopard", "mac"]
-        return map(self._webkit_baseline_path, search_paths)
+        port_names = ["win", "mac-snowleopard", "mac"]
+        return map(self._webkit_baseline_path, port_names)
 
     def _path_to_apache_config_file(self):
-        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'cygwin-httpd.conf')
+        return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
+                                     'cygwin-httpd.conf')

Modified: trunk/Tools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py (90075 => 90076)


--- trunk/Tools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py	2011-06-30 00:46:42 UTC (rev 90075)
+++ trunk/Tools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py	2011-06-30 01:11:42 UTC (rev 90076)
@@ -291,7 +291,6 @@
         mock_filesystem.files[file_path] = ''
 
     class TestMacPort(WebKitPort):
-        port_name = 'testmacport'
         def __init__(self):
             # FIXME: This should use MockExecutive and MockUser as well.
             WebKitPort.__init__(self, filesystem=mock_filesystem)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to