Tools/ChangeLog

 12011-06-27 Eric Seidel <eric@webkit.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 Simplify skipped file finding in preparation for adding wk2 skipped list fallback
 6 https://bugs.webkit.org/show_bug.cgi?id=63501
 7
 8 The goal was to add support for wk2 skipped lists.
 9 However, I found that our skipped list computation was a
 10 manual hack (which only worked for the mac port).
 11
 12 So I fixed a FIXME to move the skipped list finding
 13 into WebKitPort instead of MacPort.
 14 Doing so required the concept of a "port_name", since previously
 15 the only name accessible from a port object was name()
 16 which includes many things beyond "mac" or "chromium", etc.
 17
 18 Eventually I believe we'll want to re-think the way that we pass
 19 in a port_name argument to Port subclasses and expect them to parse
 20 it. But for now I just added a cls.port_name variable which contains
 21 the static information needed to compute wk2 names as well as
 22 compute Skipped list fallback which works for Mac/Win/Qt and Gtk.
 23
 24 In order to test my new _skipped_file_search_paths method, I
 25 fixed another FIXME by making it return relative paths.
 26
 27 I also fixed the test_expectations_path code in WebKitPort to use port_name.
 28 It was using name() which would return PORT-VERSION so MacPort was overriding
 29 it to use just PORT. After fixing test_expectations_path to use port_name
 30 (and making it aware of webkit2) I was able to remove the MacPort implementation.
 31
 32 * Scripts/webkitpy/layout_tests/port/base.py:
 33 - Add port_name() to access "mac", since name() returns "mac-leopard" etc.
 34 - Document that real_name() seems to have no purpose.
 35 * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
 36 - Add _parse_port_name(), eventually we might call this from WebKitPort directly.
 37 * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
 38 - Add _parse_port_name.
 39 * Scripts/webkitpy/layout_tests/port/chromium_win.py:
 40 - Add _parse_port_name.
 41 * Scripts/webkitpy/layout_tests/port/gtk.py:
 42 * Scripts/webkitpy/layout_tests/port/mac.py:
 43 - Move Skipped-file finding code down to WebKitPort
 44 * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
 45 * Scripts/webkitpy/layout_tests/port/qt.py:
 46 * Scripts/webkitpy/layout_tests/port/webkit.py:
 47 * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
 48
1492011-06-29 Eric Seidel <eric@webkit.org>
250
351 Adam says cowboys don't review (or unit test).

Tools/Scripts/webkitpy/layout_tests/port/base.py

@@_log = logutils.get_logger(__file__)
6666
6767
6868class DummyOptions(object):
69  """Fake implementation of optparse.Values. Cloned from
70  webkitpy.tool.mocktool.MockOptions.
71 
72  """
 69 """Fake implementation of optparse.Values. Cloned from webkitpy.tool.mocktool.MockOptions."""
7370
7471 def __init__(self, **kwargs):
7572 # The caller can set option values using keyword arguments. We don't

@@class DummyOptions(object):
8178 self.__dict__[key] = value
8279
8380
84 # FIXME: This class should merge with webkitpy.webkit_port at some point.
 81# FIXME: This class should merge with webkitpy.common.config.ports.
8582class Port(object):
8683 """Abstract class for Port-specific hooks for the layout_test package."""
8784
 85 port_name = None # Subclasses override this
 86
8887 def __init__(self, port_name=None, options=None,
8988 executive=None,
9089 user=None,
9190 filesystem=None,
9291 config=None,
9392 **kwargs):
94  self._name = port_name
9593
9694 # These are default values that should be overridden in a subclasses.
97  # FIXME: These should really be passed in.
 95 self._name = port_name or self.port_name # Subclasses may append a -VERSION (like mac-leopard) or other qualifiers.
9896 self._operating_system = 'mac'
9997 self._version = ''
10098 self._architecture = 'x86'

@@class Port(object):
112110
113111 self._helper = None
114112 self._http_server = None
115  self._webkit_base_dir = None
116113 self._websocket_server = None
117  self._http_lock = None
 114 self._http_lock = None # FIXME: Why does this live on the port object?
118115
119116 # Python's Popen has a bug that causes any pipes opened to a
120117 # process that can't be executed to be leaked. Since this

@@class Port(object):
132129 self._wdiff_available = None
133130
134131 # FIXME: prettypatch.py knows this path, why is it copied here?
135  self._pretty_patch_path = self.path_from_webkit_base("Websites",
136  "bugs.webkit.org", "PrettyPatch", "prettify.rb")
 132 self._pretty_patch_path = self.path_from_webkit_base("Websites", "bugs.webkit.org", "PrettyPatch", "prettify.rb")
137133 self._pretty_patch_available = None
138134
139135 self.set_option_default('configuration', self.default_configuration())
140  self._test_configuration = None
 136 self._test_configuration = None # FIXME: This does not belong on the real object.
141137 self._multiprocessing_is_available = (multiprocessing is not None)
142138 self._results_directory = None
143139 self.set_option_default('use_apache', self._default_to_apache())

@@class Port(object):
153149 return self._pretty_patch_available
154150
155151 def default_child_processes(self):
156  """Return the number of DumpRenderTree instances to use for this
157  port."""
 152 """Return the number of DumpRenderTree instances to use for this port."""
158153 return self._executive.cpu_count()
159154
160155 def default_worker_model(self):

@@class Port(object):
163158 return 'threads'
164159
165160 def baseline_path(self):
166  """Return the absolute path to the directory to store new baselines
167  in for this port."""
168  baseline_search_paths = \
169  self.get_option('additional_platform_directory', []) + self.baseline_search_path()
 161 """Return the absolute path to the directory to store new baselines in for this port."""
 162 baseline_search_paths = self.get_option('additional_platform_directory', []) + self.baseline_search_path()
170163 return baseline_search_paths[0]
171164
172165 def baseline_search_path(self):

@@class Port(object):
247240 return expected_text != actual_text
248241
249242 def compare_audio(self, expected_audio, actual_audio):
 243 # FIXME: If we give this method a better name it won't need this docstring (e.g. are_audio_results_equal()).
250244 """Return whether the two audio files are *not* equal."""
251245 return expected_audio != actual_audio
252246
253  def diff_image(self, expected_contents, actual_contents,
254  diff_filename=None, tolerance=0):
 247 def diff_image(self, expected_contents, actual_contents, diff_filename=None, tolerance=0):
255248 """Compare two images and produce a delta image file.
256249
257250 Return True if the two images are different, False if they are the same.

@@class Port(object):
333326
334327 baselines = []
335328 for platform_dir in baseline_search_path:
336  if self.path_exists(self._filesystem.join(platform_dir,
337  baseline_filename)):
 329 if self.path_exists(self._filesystem.join(platform_dir, baseline_filename)):
338330 baselines.append((platform_dir, baseline_filename))
339331
340332 if not all_baselines and baselines:

@@class Port(object):
371363 This routine is generic but is implemented here to live alongside
372364 the other baseline and filename manipulation routines.
373365 """
374  platform_dir, baseline_filename = self.expected_baselines(
375  filename, suffix)[0]
 366 # FIXME: The [0] here is very mysterious, as is the destructured return.
 367 platform_dir, baseline_filename = self.expected_baselines(filename, suffix)[0]
376368 if platform_dir:
377369 return self._filesystem.join(platform_dir, baseline_filename)
378370 return self._filesystem.join(self.layout_tests_dir(), baseline_filename)

@@class Port(object):
456448 return test_files.find(self, paths)
457449
458450 def test_dirs(self):
459  """Returns the list of top-level test directories.
460 
461  Used by --clobber-old-results."""
 451 """Returns the list of top-level test directories."""
462452 layout_tests_dir = self.layout_tests_dir()
463453 return filter(lambda x: self._filesystem.isdir(self._filesystem.join(layout_tests_dir, x)),
464454 self._filesystem.listdir(layout_tests_dir))

@@class Port(object):
539529 self._filesystem.maybe_make_directory(*path)
540530
541531 def name(self):
542  """Return the name of the port (e.g., 'mac', 'chromium-win-xp')."""
 532 """Returns a name that uniquely identifies this particular type of port
 533 (e.g., "mac-snowleopard" or "chromium-gpu-linux-x86_x64" and can be passed
 534 to factory.get() to instantiate the port."""
543535 return self._name
544536
 537 def real_name(self):
 538 # FIXME: Seems this is only used for MockDRT and should be removed.
 539 """Returns the name of the port as passed to the --platform command line argument."""
 540 return self.name()
 541
545542 def operating_system(self):
546543 return self._operating_system
547544

@@class Port(object):
568565 def architecture(self):
569566 return self._architecture
570567
571  def real_name(self):
572  """Returns the actual name of the port, not the delegate's."""
573  return self.name()
574 
575568 def get_option(self, name, default_value=None):
576569 # FIXME: Eventually we should not have to do a test for
577570 # hasattr(), and we should be able to just do

@@class Port(object):
641634 return self._user.open_url(results_filename)
642635
643636 def create_driver(self, worker_number):
644  """Return a newly created base.Driver subclass for starting/stopping
645  the test driver."""
 637 """Return a newly created base.Driver subclass for starting/stopping the test driver."""
646638 raise NotImplementedError('Port.create_driver')
647639
648640 def start_helper(self):

@@class Port(object):
876868 raise NotImplementedError('Port._path_to_helper')
877869
878870 def _path_to_image_diff(self):
879  """Returns the full path to the image_diff binary, or None if it
880  is not available.
 871 """Returns the full path to the image_diff binary, or None if it is not available.
881872
882873 This is likely used only by diff_image()"""
883874 raise NotImplementedError('Port.path_to_image_diff')

Tools/Scripts/webkitpy/layout_tests/port/chromium.py

@@from webkitpy.layout_tests.servers import websocket_server
5353_log = logging.getLogger("webkitpy.layout_tests.port.chromium")
5454
5555
56 # FIXME: This function doesn't belong in this package.
5756class ChromiumPort(base.Port):
5857 """Abstract base class for Chromium implementations of the Port class."""
 58
 59 port_name = "chromium"
 60
5961 ALL_BASELINE_VARIANTS = [
6062 'chromium-mac-snowleopard', 'chromium-mac-leopard',
6163 'chromium-win-win7', 'chromium-win-vista', 'chromium-win-xp',

@@class ChromiumPort(base.Port):
346348
347349
348350class ChromiumDriver(base.Driver):
349  """Abstract interface for DRT."""
350 
351351 def __init__(self, port, worker_number):
352352 self._port = port
353353 self._worker_number = worker_number

Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py

@@class ChromiumLinuxPort(chromium.ChromiumPort):
4848 def __init__(self, port_name=None, **kwargs):
4949 port_name = port_name or 'chromium-linux'
5050 chromium.ChromiumPort.__init__(self, port_name=port_name, **kwargs)
51 
5251 # We re-set the port name once the base object is fully initialized
5352 # in order to be able to find the DRT binary properly.
5453 if port_name.endswith('-linux'):

Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py

@@class ChromiumMacPort(chromium.ChromiumPort):
7676 self._version = mac.os_version(os_version_string, self.SUPPORTED_OS_VERSIONS)
7777 self._name = port_name + '-' + self._version
7878 else:
79  self._version = port_name[port_name.index('-mac-') + 5:]
 79 self._version = port_name[port_name.index('-mac-') + len('-mac-'):]
8080 assert self._version in self.SUPPORTED_OS_VERSIONS
8181 self._operating_system = 'mac'
8282

Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py

@@class ChromiumWinPort(chromium.ChromiumPort):
7474 self._version = os_version(windows_version)
7575 self._name = port_name + '-' + self._version
7676 else:
77  self._version = port_name[port_name.index('-win-') + 5:]
78  assert self._version in self.SUPPORTED_VERSIONS
79 
 77 self._version = port_name[port_name.index('-win-') + len('-win-'):]
 78 assert self._version in self.SUPPORTED_VERSIONS, "%s is not in %s" % (self._version, self.SUPPORTED_VERSIONS)
8079 self._operating_system = 'win'
8180
8281 def setup_environ_for_server(self):

Tools/Scripts/webkitpy/layout_tests/port/gtk.py

@@_log = logging.getLogger("webkitpy.layout_tests.port.gtk")
3939
4040
4141class GtkDriver(webkit.WebKitDriver):
42  """WebKit Gtk implementation of the Driver class."""
43 
4442 def start(self):
4543 display_id = self._worker_number + 1
4644 run_xvfb = ["Xvfb", ":%d" % (display_id)]

@@class GtkDriver(webkit.WebKitDriver):
5755
5856
5957class GtkPort(webkit.WebKitPort):
60  """WebKit Gtk implementation of the Port class."""
61 
62  def __init__(self, **kwargs):
63  kwargs.setdefault('port_name', 'gtk')
64  webkit.WebKitPort.__init__(self, **kwargs)
 58 port_name = "gtk"
6559
6660 def create_driver(self, worker_number):
6761 return GtkDriver(self, worker_number)
6862
6963 def _path_to_apache_config_file(self):
7064 # FIXME: This needs to detect the distribution and change config files.
71  return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
72  'apache2-debian-httpd.conf')
 65 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-debian-httpd.conf')
7366
7467 def _path_to_driver(self):
7568 return self._build_path('Programs', self.driver_name())
7669
7770 def check_build(self, needs_http):
78  if not self._check_driver():
79  return False
80  return True
 71 return self._check_driver()
8172
8273 def _path_to_apache(self):
8374 if self._is_redhat_based():

@@class GtkPort(webkit.WebKitPort):
9182 else:
9283 config_name = 'apache2-debian-httpd.conf'
9384
94  return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
95  config_name)
 85 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', config_name)
9686
9787 def _path_to_wdiff(self):
9888 if self._is_redhat_based():

@@class GtkPort(webkit.WebKitPort):
115105 if os.path.isfile(full_library):
116106 return full_library
117107
118  return None
119 
120108 def _runtime_feature_list(self):
121109 return None

Tools/Scripts/webkitpy/layout_tests/port/mac.py

@@def os_version(os_version_string=None, supported_versions=None):
4848 version_strings = {
4949 5: 'leopard',
5050 6: 'snowleopard',
 51 # Add 7: 'lion' here?
5152 }
5253 assert release_version >= min(version_strings.keys())
5354 version_string = version_strings.get(release_version, 'future')

@@def os_version(os_version_string=None, supported_versions=None):
5758
5859
5960class MacPort(WebKitPort):
60  """WebKit Mac implementation of the Port class."""
 61 port_name = "mac"
 62
6163 # FIXME: 'wk2' probably shouldn't be a version, it should probably be
6264 # a modifier, like 'chromium-gpu' is to 'chromium'.
6365 SUPPORTED_VERSIONS = ('leopard', 'snowleopard', 'future', 'wk2')

@@class MacPort(WebKitPort):
6668 'leopard': ['mac-leopard', 'mac-snowleopard', 'mac'],
6769 'snowleopard': ['mac-snowleopard', 'mac'],
6870 'future': ['mac'],
 71 # FIXME: This isn't quite right for wk2, it should include mac-VERSION as well.
6972 'wk2': ['mac-wk2', 'mac'],
7073 }
7174

@@class MacPort(WebKitPort):
7679 self._version = os_version(os_version_string)
7780 self._name = port_name + '-' + self._version
7881 else:
79  self._version = port_name[4:]
80  assert self._version in self.SUPPORTED_VERSIONS
 82 assert port_name.startswith('mac')
 83 self._version = port_name[len('mac-'):]
 84 assert self._version in self.SUPPORTED_VERSIONS, "%s is not in %s" % (self._version, self.SUPPORTED_VERSIONS)
8185 self._operating_system = 'mac'
8286 if not hasattr(self._options, 'time-out-ms') or self._options.time_out_ms is None:
8387 self._options.time_out_ms = 35000

@@class MacPort(WebKitPort):
9498 def baseline_search_path(self):
9599 return map(self._webkit_baseline_path, self.FALLBACK_PATHS[self._version])
96100
97  def path_to_test_expectations_file(self):
98  return self.path_from_webkit_base('LayoutTests', 'platform',
99  'mac', 'test_expectations.txt')
100 
101101 def is_crash_reporter(self, process_name):
102102 return re.search(r'ReportCrash', process_name)
103103
104  def _skipped_file_paths(self):
105  # FIXME: This method will need to be made work for non-mac
106  # platforms and moved into base.Port.
107  skipped_files = []
108  if self._name in ('mac-leopard', 'mac-snowleopard'):
109  skipped_files.append(self._filesystem.join(
110  self._webkit_baseline_path(self._name), 'Skipped'))
111  skipped_files.append(self._filesystem.join(self._webkit_baseline_path('mac'),
112  'Skipped'))
113  return skipped_files
114 
115104 def _build_java_test_support(self):
116105 java_tests_path = self._filesystem.join(self.layout_tests_dir(), "java")
117106 build_java = ["/usr/bin/make", "-C", java_tests_path]

@@class MacPort(WebKitPort):
124113 return self._build_java_test_support()
125114
126115 def _path_to_apache_config_file(self):
127  return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
128  'apache2-httpd.conf')
 116 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-httpd.conf')
129117
130118 def _path_to_webcore_library(self):
131119 return self._build_path('WebCore.framework/Versions/A/WebCore')

Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py

@@class MacTest(port_testcase.PortTestCase):
4040 return None
4141 return mac.MacPort
4242
43  def assert_skipped_files_for_version(self, port_name, expected_paths):
 43 def assert_skipped_file_search_paths(self, port_name, expected_paths):
4444 port = mac.MacPort(port_name=port_name)
45  skipped_paths = port._skipped_file_paths()
46  # FIXME: _skipped_file_paths should return WebKit-relative paths.
47  # So to make it unit testable, we strip the WebKit directory from the path.
48  relative_paths = [path[len(port.path_from_webkit_base()):] for path in skipped_paths]
49  self.assertEqual(relative_paths, expected_paths)
50 
51  def test_skipped_file_paths(self):
52  # We skip this on win32 because we use '/' as the dir separator and it's
53  # not worth making platform-independent.
 45 self.assertEqual(port._skipped_file_search_paths(), expected_paths)
 46
 47 def test_skipped_file_search_paths(self):
 48 # FIXME: This should no longer be necessary, but I'm not brave enough to remove it.
5449 if sys.platform == 'win32':
5550 return None
5651
57  self.assert_skipped_files_for_version('mac-snowleopard',
58  ['/LayoutTests/platform/mac-snowleopard/Skipped', '/LayoutTests/platform/mac/Skipped'])
59  self.assert_skipped_files_for_version('mac-leopard',
60  ['/LayoutTests/platform/mac-leopard/Skipped', '/LayoutTests/platform/mac/Skipped'])
 52 self.assert_skipped_file_search_paths('mac-snowleopard', set(['mac-snowleopard', 'mac']))
 53 self.assert_skipped_file_search_paths('mac-leopard', set(['mac-leopard', 'mac']))
 54 # We cannot test just "mac" here as the MacPort constructor automatically fills in the version from the running OS.
 55 # self.assert_skipped_file_search_paths('mac', ['mac'])
 56
6157
6258 example_skipped_file = u"""
6359# <rdar://problem/5647952> fast/events/mouseout-on-window.html needs mac DRT to issue mouse out events

Tools/Scripts/webkitpy/layout_tests/port/qt.py

@@_log = logging.getLogger("webkitpy.layout_tests.port.qt")
3939
4040
4141class QtPort(WebKitPort):
42  """QtWebKit implementation of the Port class."""
43 
44  def __init__(self, **kwargs):
45  kwargs.setdefault('port_name', 'qt')
46  WebKitPort.__init__(self, **kwargs)
 42 port_name = "qt"
4743
4844 def baseline_search_path(self):
4945 port_names = []

@@class QtPort(WebKitPort):
5854
5955 def _path_to_apache_config_file(self):
6056 # FIXME: This needs to detect the distribution and change config files.
61  return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
62  'apache2-debian-httpd.conf')
 57 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'apache2-debian-httpd.conf')
6358
6459 def _build_driver(self):
6560 # The Qt port builds DRT as part of the main build step

Tools/Scripts/webkitpy/layout_tests/port/webkit.py

@@import logging
3636import operator
3737import os
3838import re
39 import signal
40 import sys
4139import time
42 import webbrowser
43 
4440
4541from webkitpy.common.net.buildbot import BuildBot
46 from webkitpy.common.system import ospath
4742from webkitpy.common.system.executive import ScriptError
4843from webkitpy.layout_tests.port import base, builders, server_process
4944
50 _log = logging.getLogger("webkitpy.layout_tests.port.webkit")
5145
 46_log = logging.getLogger(__file__)
5247
53 class WebKitPort(base.Port):
54  """WebKit implementation of the Port class."""
5548
 49class WebKitPort(base.Port):
5650 def __init__(self, **kwargs):
5751 base.Port.__init__(self, **kwargs)
58  self._cached_apache_path = None
 52 self._cached_apache_path = None # FIXME: This class should use @memoized instead.
5953
6054 # FIXME: disable pixel tests until they are run by default on the build machines.
6155 self.set_option_default("pixel_tests", False)

@@class WebKitPort(base.Port):
6559 return "WebKitTestRunner"
6660 return "DumpRenderTree"
6761
 62 # FIXME: This is not a very useful default implementation, as its wrong for any
 63 # port which uses version-specific fallback (e.g. ['mac-leapard', 'mac']).
 64 # We should replace this with a smarter implementation shared by all ports.
6865 def baseline_search_path(self):
69  return [self._webkit_baseline_path(self._name)]
 66 search_paths = [self.name()]
 67 if self.get_option('webkit_test_runner'):
 68 search_paths.insert(0, self._wk2_port_name())
 69 return search_paths
 70
 71 def _expectations_search_path(self):
 72 # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name().
 73 return self._wk2_port_name() if self.get_option('webkit_test_runner') else self.port_name
7074
7175 def path_to_test_expectations_file(self):
72  return self._filesystem.join(self._webkit_baseline_path(self._name),
73  'test_expectations.txt')
 76 return self._filesystem.join(self._webkit_baseline_path(self._expectations_search_path()), 'test_expectations.txt')
7477
7578 def _results_for_platform(self, platform):
7679 builder_name = builders.builder_name_for_platform(platform)

@@class WebKitPort(base.Port):
284287 tests_to_skip.append(line)
285288 return tests_to_skip
286289
287  def _skipped_file_paths(self):
288  return [self._filesystem.join(self._webkit_baseline_path(self._name), 'Skipped')]
 290 def _wk2_port_name(self):
 291 # By current convention, the WebKit2 name is always mac-wk2, win-wk2, not mac-leopard-wk2, etc.
 292 return "%s-wk2" % self.port_name
 293
 294 def _skipped_file_search_paths(self):
 295 # Unlike baseline_search_path, we only want to search [WK2-PORT, PORT-VERSION, PORT] not the full casade.
 296 # Note order doesn't matter since the Skipped file contents are all combined.
 297 search_paths = set([self.port_name, self.name()])
 298 if self.get_option('webkit_test_runner'):
 299 # Quoting old-run-webkit-tests:
 300 # Because nearly all of the skipped tests for WebKit 2 on Mac are due to
 301 # cross-platform issues, the Windows and Qt ports use the Mac skipped list
 302 # additionally to their own to avoid maintaining separate lists.
 303 search_paths.update([self._wk2_port_name(), "mac-wk2"])
 304 return search_paths
289305
290306 def _expectations_from_skipped_files(self):
291307 tests_to_skip = []
292  for filename in self._skipped_file_paths():
 308 for search_path in self._skipped_file_search_paths():
 309 filename = self._filesystem.join(self._webkit_baseline_path(search_path), "Skipped")
293310 if not self._filesystem.exists(filename):
294311 _log.warn("Failed to open Skipped file: %s" % filename)
295312 continue

@@class WebKitPort(base.Port):
298315 return tests_to_skip
299316
300317 def test_expectations(self):
301  # The WebKit mac port uses a combination of a test_expectations file
302  # and 'Skipped' files.
 318 # This allows ports to use a combination of test_expectations.txt files and Skipped lists.
 319 expectations = self._skipped_list_as_expectations()
303320 expectations_path = self.path_to_test_expectations_file()
304  return self._filesystem.read_text_file(expectations_path) + self._skips()
 321 if self._filesystem.exists(expectations_path):
 322 expectations = self._filesystem.read_text_file(expectations_path) + expectations
 323 return expectations
305324
306  def _skips(self):
 325 def _skipped_list_as_expectations(self):
307326 # Each Skipped file contains a list of files
308327 # or directories to be skipped during the test run. The total list
309328 # of tests to skipped is given by the contents of the generic

@@class WebKitPort(base.Port):
313332 # format expected by test_expectations.
314333
315334 tests_to_skip = self.skipped_layout_tests()
316  skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" %
317  test_path, tests_to_skip)
 335 skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" % test_path, tests_to_skip)
318336 return "\n".join(skip_lines)
319337
320338 def skipped_layout_tests(self):

Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py

@@from webkitpy.tool.mocktool import MockExecutive, MockOptions, MockUser
3737
3838
3939class TestWebKitPort(WebKitPort):
 40 port_name = "testwebkitport"
 41
4042 def __init__(self, symbol_list=None, feature_list=None,
4143 expectations_file=None, skips_file=None,
4244 executive=None, filesystem=None, user=None,

@@class TestWebKitPort(WebKitPort):
4648 executive = executive or MockExecutive(should_log=False)
4749 filesystem = filesystem or MockFileSystem()
4850 user = user or MockUser()
49  WebKitPort.__init__(self, port_name="testwebkitport", executive=executive, filesystem=filesystem, user=MockUser(), **kwargs)
 51 WebKitPort.__init__(self, executive=executive, filesystem=filesystem, user=MockUser(), **kwargs)
5052
5153 def _runtime_feature_list(self):
5254 return self.feature_list

@@class WebKitPortTest(port_testcase.PortTestCase):
8991 def test_skipped_layout_tests(self):
9092 self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(), set(["media"]))
9193
 94 def test_skipped_file_search_paths(self):
 95 port = TestWebKitPort()
 96 self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport']))
 97 port._name = "testwebkitport-version"
 98 self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport', 'testwebkitport-version']))
 99 port._options = MockOptions(webkit_test_runner=True)
 100 self.assertEqual(port._skipped_file_search_paths(), set(['testwebkitport', 'testwebkitport-version', 'testwebkitport-wk2', 'mac-wk2']))
 101
92102 def test_test_expectations(self):
93103 # Check that we read both the expectations file and anything in a
94104 # Skipped file, and that we include the feature and platform checks.

Tools/Scripts/webkitpy/layout_tests/port/win.py

@@import logging
3232
3333from webkitpy.layout_tests.port.webkit import WebKitPort
3434
35 _log = logging.getLogger("webkitpy.layout_tests.port.win")
 35_log = logging.getLogger(__file__)
3636
3737
3838class WinPort(WebKitPort):
39  """WebKit Win implementation of the Port class."""
 39 port_name = "win"
4040
41  def __init__(self, port_name=None, **kwargs):
42  port_name = port_name or 'win'
43  WebKitPort.__init__(self, port_name=port_name, **kwargs)
 41 def __init__(self, **kwargs):
 42 WebKitPort.__init__(self, **kwargs)
4443 self._version = 'win7'
4544 self._operating_system = 'win'
4645
4746 def baseline_search_path(self):
4847 # Based on code from old-run-webkit-tests expectedDirectoryForTest()
49  port_names = ["win", "mac-snowleopard", "mac"]
50  return map(self._webkit_baseline_path, port_names)
 48 search_paths = ["win", "mac-snowleopard", "mac"]
 49 return map(self._webkit_baseline_path, search_paths)
5150
5251 def _path_to_apache_config_file(self):
53  return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf',
54  'cygwin-httpd.conf')
 52 return self._filesystem.join(self.layout_tests_dir(), 'http', 'conf', 'cygwin-httpd.conf')

Tools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py

@@def get_test_config(test_files=[], result_files=[]):
291291 mock_filesystem.files[file_path] = ''
292292
293293 class TestMacPort(WebKitPort):
 294 port_name = 'testmacport'
294295 def __init__(self):
295296 # FIXME: This should use MockExecutive and MockUser as well.
296297 WebKitPort.__init__(self, filesystem=mock_filesystem)