Changeset 90077 in webkit
- Timestamp:
- Jun 29, 2011 6:36:03 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r90076 r90077 1 2011-06-29 Eric Seidel <eric@webkit.org> 2 3 Reviewed by Adam Barth. 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 Re-landing after fixing a bug in WebKitPort.baseline_search_path which broke 9 the rebaselineserver unit tests. Also fixed nits brought up by Dirk after previous landing. 10 11 The goal was to add support for wk2 skipped lists. 12 However, I found that our skipped list computation was a 13 manual hack (which only worked for the mac port). 14 15 So I fixed a FIXME to move the skipped list finding 16 into WebKitPort instead of MacPort. 17 Doing so required the concept of a "port_name", since previously 18 the only name accessible from a port object was name() 19 which includes many things beyond "mac" or "chromium", etc. 20 21 Eventually I believe we'll want to re-think the way that we pass 22 in a port_name argument to Port subclasses and expect them to parse 23 it. But for now I just added a cls.port_name variable which contains 24 the static information needed to compute wk2 names as well as 25 compute Skipped list fallback which works for Mac/Win/Qt and Gtk. 26 27 In order to test my new _skipped_file_search_paths method, I 28 fixed another FIXME by making it return relative paths. 29 30 I also fixed the test_expectations_path code in WebKitPort to use port_name. 31 It was using name() which would return PORT-VERSION so MacPort was overriding 32 it to use just PORT. After fixing test_expectations_path to use port_name 33 (and making it aware of webkit2) I was able to remove the MacPort implementation. 34 35 * Scripts/webkitpy/layout_tests/port/base.py: 36 - Add port_name() to access "mac", since name() returns "mac-leopard" etc. 37 - Document that real_name() seems to have no purpose. 38 * Scripts/webkitpy/layout_tests/port/chromium_linux.py: 39 - Add _parse_port_name(), eventually we might call this from WebKitPort directly. 40 * Scripts/webkitpy/layout_tests/port/chromium_mac.py: 41 - Add _parse_port_name. 42 * Scripts/webkitpy/layout_tests/port/chromium_win.py: 43 - Add _parse_port_name. 44 * Scripts/webkitpy/layout_tests/port/gtk.py: 45 * Scripts/webkitpy/layout_tests/port/mac.py: 46 - Move Skipped-file finding code down to WebKitPort 47 * Scripts/webkitpy/layout_tests/port/mac_unittest.py: 48 * Scripts/webkitpy/layout_tests/port/qt.py: 49 * Scripts/webkitpy/layout_tests/port/webkit.py: 50 * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: 51 1 52 2011-06-29 Sheriff Bot <webkit.review.bot@gmail.com> 2 53 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/base.py
r90076 r90077 67 67 68 68 class 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.""" 73 70 74 71 def __init__(self, **kwargs): … … 82 79 83 80 84 # FIXME: This class should merge with webkitpy. webkit_port at some point.81 # FIXME: This class should merge with webkitpy.common.config.ports. 85 82 class Port(object): 86 83 """Abstract class for Port-specific hooks for the layout_test package.""" 84 85 port_name = None # Subclasses override this 87 86 88 87 def __init__(self, port_name=None, options=None, … … 92 91 config=None, 93 92 **kwargs): 94 self._name = port_name95 93 96 94 # 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. 98 96 self._operating_system = 'mac' 99 97 self._version = '' … … 113 111 self._helper = None 114 112 self._http_server = None 115 self._webkit_base_dir = None116 113 self._websocket_server = None 117 self._http_lock = None 114 self._http_lock = None # FIXME: Why does this live on the port object? 118 115 119 116 # Python's Popen has a bug that causes any pipes opened to a … … 133 130 134 131 # 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") 137 133 self._pretty_patch_available = None 138 134 … … 154 150 155 151 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.""" 158 153 return self._executive.cpu_count() 159 154 … … 164 159 165 160 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() 170 163 return baseline_search_paths[0] 171 164 … … 248 241 249 242 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()). 250 244 """Return whether the two audio files are *not* equal.""" 251 245 return expected_audio != actual_audio 252 246 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): 255 248 """Compare two images and produce a delta image file. 256 249 … … 334 327 baselines = [] 335 328 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)): 338 330 baselines.append((platform_dir, baseline_filename)) 339 331 … … 344 336 # result in the test directory, even if no such file actually exists. 345 337 platform_dir = self.layout_tests_dir() 346 if self.path_exists(self._filesystem.join(platform_dir, 347 baseline_filename)): 338 if self.path_exists(self._filesystem.join(platform_dir, baseline_filename)): 348 339 baselines.append((platform_dir, baseline_filename)) 349 340 … … 372 363 the other baseline and filename manipulation routines. 373 364 """ 374 platform_dir, baseline_filename = self.expected_baselines(375 365 # FIXME: The [0] here is very mysterious, as is the destructured return. 366 platform_dir, baseline_filename = self.expected_baselines(filename, suffix)[0] 376 367 if platform_dir: 377 368 return self._filesystem.join(platform_dir, baseline_filename) … … 457 448 458 449 def test_dirs(self): 459 """Returns the list of top-level test directories. 460 461 Used by --clobber-old-results.""" 450 """Returns the list of top-level test directories.""" 462 451 layout_tests_dir = self.layout_tests_dir() 463 452 return filter(lambda x: self._filesystem.isdir(self._filesystem.join(layout_tests_dir, x)), … … 540 529 541 530 def name(self): 542 """Return the name of the port (e.g., 'mac', 'chromium-win-xp').""" 531 """Returns a name that uniquely identifies this particular type of port 532 (e.g., "mac-snowleopard" or "chromium-gpu-linux-x86_x64" and can be passed 533 to factory.get() to instantiate the port.""" 543 534 return self._name 535 536 def real_name(self): 537 # FIXME: Seems this is only used for MockDRT and should be removed. 538 """Returns the name of the port as passed to the --platform command line argument.""" 539 return self.name() 544 540 545 541 def operating_system(self): … … 568 564 def architecture(self): 569 565 return self._architecture 570 571 def real_name(self):572 """Returns the actual name of the port, not the delegate's."""573 return self.name()574 566 575 567 def get_option(self, name, default_value=None): … … 642 634 643 635 def create_driver(self, worker_number): 644 """Return a newly created base.Driver subclass for starting/stopping 645 the test driver.""" 636 """Return a newly created base.Driver subclass for starting/stopping the test driver.""" 646 637 raise NotImplementedError('Port.create_driver') 647 638 … … 877 868 878 869 def _path_to_image_diff(self): 879 """Returns the full path to the image_diff binary, or None if it 880 is not available. 870 """Returns the full path to the image_diff binary, or None if it is not available. 881 871 882 872 This is likely used only by diff_image()""" -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium.py
r90076 r90077 54 54 55 55 56 # FIXME: This function doesn't belong in this package.57 56 class ChromiumPort(base.Port): 58 57 """Abstract base class for Chromium implementations of the Port class.""" 58 59 port_name = "chromium" 60 59 61 ALL_BASELINE_VARIANTS = [ 60 62 'chromium-mac-snowleopard', 'chromium-mac-leopard', … … 347 349 348 350 class ChromiumDriver(base.Driver): 349 """Abstract interface for DRT."""350 351 351 def __init__(self, port, worker_number): 352 352 self._port = port -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
r90076 r90077 49 49 port_name = port_name or 'chromium-linux' 50 50 chromium.ChromiumPort.__init__(self, port_name=port_name, **kwargs) 51 52 51 # We re-set the port name once the base object is fully initialized 53 52 # in order to be able to find the DRT binary properly. -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
r90076 r90077 77 77 self._name = port_name + '-' + self._version 78 78 else: 79 self._version = port_name[port_name.index('-mac-') + 5:]79 self._version = port_name[port_name.index('-mac-') + len('-mac-'):] 80 80 assert self._version in self.SUPPORTED_OS_VERSIONS 81 81 self._operating_system = 'mac' -
trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py
r90076 r90077 75 75 self._name = port_name + '-' + self._version 76 76 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) 80 79 self._operating_system = 'win' 81 80 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/gtk.py
r90076 r90077 40 40 41 41 class GtkDriver(webkit.WebKitDriver): 42 """WebKit Gtk implementation of the Driver class."""43 44 42 def start(self): 45 43 display_id = self._worker_number + 1 … … 58 56 59 57 class 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" 65 59 66 60 def create_driver(self, worker_number): … … 69 63 def _path_to_apache_config_file(self): 70 64 # 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') 73 66 74 67 def _path_to_driver(self): … … 76 69 77 70 def check_build(self, needs_http): 78 if not self._check_driver(): 79 return False 80 return True 71 return self._check_driver() 81 72 82 73 def _path_to_apache(self): … … 92 83 config_name = 'apache2-debian-httpd.conf' 93 84 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) 96 86 97 87 def _path_to_wdiff(self): … … 115 105 if os.path.isfile(full_library): 116 106 return full_library 117 118 107 return None 119 108 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mac.py
r90076 r90077 49 49 5: 'leopard', 50 50 6: 'snowleopard', 51 # Add 7: 'lion' here? 51 52 } 52 53 assert release_version >= min(version_strings.keys()) … … 58 59 59 60 class MacPort(WebKitPort): 60 """WebKit Mac implementation of the Port class.""" 61 port_name = "mac" 62 61 63 # FIXME: 'wk2' probably shouldn't be a version, it should probably be 62 64 # a modifier, like 'chromium-gpu' is to 'chromium'. … … 67 69 'snowleopard': ['mac-snowleopard', 'mac'], 68 70 'future': ['mac'], 71 # FIXME: This isn't quite right for wk2, it should include mac-VERSION as well. 69 72 'wk2': ['mac-wk2', 'mac'], 70 73 } … … 77 80 self._name = port_name + '-' + self._version 78 81 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) 81 85 self._operating_system = 'mac' 82 86 if not hasattr(self._options, 'time-out-ms') or self._options.time_out_ms is None: … … 95 99 return map(self._webkit_baseline_path, self.FALLBACK_PATHS[self._version]) 96 100 97 def path_to_test_expectations_file(self):98 return self.path_from_webkit_base('LayoutTests', 'platform',99 'mac', 'test_expectations.txt')100 101 101 def is_crash_reporter(self, process_name): 102 102 return re.search(r'ReportCrash', process_name) 103 104 def _skipped_file_paths(self):105 # FIXME: This method will need to be made work for non-mac106 # 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_files114 103 115 104 def _build_java_test_support(self): … … 125 114 126 115 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') 129 117 130 118 def _path_to_webcore_library(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
r90076 r90077 41 41 return mac.MacPort 42 42 43 def assert_skipped_file s_for_version(self, port_name, expected_paths):43 def assert_skipped_file_search_paths(self, port_name, expected_paths): 44 44 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) 45 self.assertEqual(port._skipped_file_search_paths(), expected_paths) 50 46 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. 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. 54 49 if sys.platform == 'win32': 55 50 return None 56 51 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 61 57 62 58 example_skipped_file = u""" -
trunk/Tools/Scripts/webkitpy/layout_tests/port/qt.py
r90076 r90077 40 40 41 41 class 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" 47 43 48 44 def baseline_search_path(self): … … 59 55 def _path_to_apache_config_file(self): 60 56 # 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') 63 58 64 59 def _build_driver(self): -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit.py
r90076 r90077 37 37 import os 38 38 import re 39 import signal40 import sys41 39 import time 42 import webbrowser43 44 40 45 41 from webkitpy.common.net.buildbot import BuildBot 46 from webkitpy.common.system import ospath47 42 from webkitpy.common.system.executive import ScriptError 48 43 from webkitpy.layout_tests.port import base, builders, server_process 49 44 50 _log = logging.getLogger("webkitpy.layout_tests.port.webkit") 45 46 _log = logging.getLogger(__file__) 51 47 52 48 53 49 class WebKitPort(base.Port): 54 """WebKit implementation of the Port class."""55 56 50 def __init__(self, **kwargs): 57 51 base.Port.__init__(self, **kwargs) 58 self._cached_apache_path = None 52 self._cached_apache_path = None # FIXME: This class should use @memoized instead. 59 53 60 54 # FIXME: disable pixel tests until they are run by default on the build machines. … … 66 60 return "DumpRenderTree" 67 61 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. 68 65 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 map(self._webkit_baseline_path, search_paths) 70 70 71 71 def path_to_test_expectations_file(self): 72 return self._filesystem.join(self._webkit_baseline_path(self._name), 73 'test_expectations.txt') 72 # test_expectations are always in mac/ not mac-leopard/ by convention, hence we use port_name instead of name(). 73 expectations_directory = self._wk2_port_name() if self.get_option('webkit_test_runner') else self.port_name 74 return self._filesystem.join(self._webkit_baseline_path(expectations_directory), 'test_expectations.txt') 74 75 75 76 def _results_for_platform(self, platform): … … 285 286 return tests_to_skip 286 287 287 def _skipped_file_paths(self): 288 return [self._filesystem.join(self._webkit_baseline_path(self._name), 'Skipped')] 288 def _wk2_port_name(self): 289 # By current convention, the WebKit2 name is always mac-wk2, win-wk2, not mac-leopard-wk2, etc. 290 return "%s-wk2" % self.port_name 291 292 def _skipped_file_search_paths(self): 293 # Unlike baseline_search_path, we only want to search [WK2-PORT, PORT-VERSION, PORT] not the full casade. 294 # Note order doesn't matter since the Skipped file contents are all combined. 295 search_paths = set([self.port_name, self.name()]) 296 if self.get_option('webkit_test_runner'): 297 # Quoting old-run-webkit-tests: 298 # Because nearly all of the skipped tests for WebKit 2 on Mac are due to 299 # cross-platform issues, the Windows and Qt ports use the Mac skipped list 300 # additionally to their own to avoid maintaining separate lists. 301 search_paths.update([self._wk2_port_name(), "mac-wk2"]) 302 return search_paths 289 303 290 304 def _expectations_from_skipped_files(self): 291 305 tests_to_skip = [] 292 for filename in self._skipped_file_paths(): 306 for search_path in self._skipped_file_search_paths(): 307 filename = self._filesystem.join(self._webkit_baseline_path(search_path), "Skipped") 293 308 if not self._filesystem.exists(filename): 294 309 _log.warn("Failed to open Skipped file: %s" % filename) … … 299 314 300 315 def test_expectations(self): 301 # Th e WebKit mac port uses a combination of a test_expectations file302 # and 'Skipped' files.316 # This allows ports to use a combination of test_expectations.txt files and Skipped lists. 317 expectations = self._skipped_list_as_expectations() 303 318 expectations_path = self.path_to_test_expectations_file() 304 return self._filesystem.read_text_file(expectations_path) + self._skips() 305 306 def _skips(self): 319 if self._filesystem.exists(expectations_path): 320 expectations = self._filesystem.read_text_file(expectations_path) + expectations 321 return expectations 322 323 def _skipped_list_as_expectations(self): 307 324 # Each Skipped file contains a list of files 308 325 # or directories to be skipped during the test run. The total list … … 314 331 315 332 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) 333 skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" % test_path, tests_to_skip) 318 334 return "\n".join(skip_lines) 319 335 -
trunk/Tools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
r90076 r90077 38 38 39 39 class TestWebKitPort(WebKitPort): 40 port_name = "testwebkitport" 41 40 42 def __init__(self, symbol_list=None, feature_list=None, 41 43 expectations_file=None, skips_file=None, … … 47 49 filesystem = filesystem or MockFileSystem() 48 50 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) 50 52 51 53 def _runtime_feature_list(self): … … 90 92 self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(), set(["media"])) 91 93 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 92 102 def test_test_expectations(self): 93 103 # Check that we read both the expectations file and anything in a -
trunk/Tools/Scripts/webkitpy/layout_tests/port/win.py
r90076 r90077 33 33 from webkitpy.layout_tests.port.webkit import WebKitPort 34 34 35 _log = logging.getLogger( "webkitpy.layout_tests.port.win")35 _log = logging.getLogger(__file__) 36 36 37 37 38 38 class WinPort(WebKitPort): 39 """WebKit Win implementation of the Port class."""39 port_name = "win" 40 40 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) 44 43 self._version = 'win7' 45 44 self._operating_system = 'win' … … 51 50 52 51 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') -
trunk/Tools/Scripts/webkitpy/tool/commands/rebaselineserver.py
r85254 r90077 349 349 350 350 def _get_test_baselines(test_file, test_config): 351 # FIXME: This seems like a hack. This only seems used to access the Port.expected_baselines logic. 351 352 class AllPlatformsPort(WebKitPort): 352 353 def __init__(self): 353 354 WebKitPort.__init__(self, filesystem=test_config.filesystem) 354 self._platforms_by_directory = dict( 355 [(self._webkit_baseline_path(p), p) for p in test_config.platforms]) 355 self._platforms_by_directory = dict([(self._webkit_baseline_path(p), p) for p in test_config.platforms]) 356 356 357 357 def baseline_search_path(self): … … 361 361 return self._platforms_by_directory[directory] 362 362 363 test_path = test_config.filesystem.join( 364 test_config.layout_tests_directory, test_file) 363 test_path = test_config.filesystem.join(test_config.layout_tests_directory, test_file) 365 364 366 365 all_platforms_port = AllPlatformsPort() … … 368 367 all_test_baselines = {} 369 368 for baseline_extension in ('.txt', '.checksum', '.png'): 370 test_baselines = test_config.test_port.expected_baselines( 371 test_path, baseline_extension) 372 baselines = all_platforms_port.expected_baselines( 373 test_path, baseline_extension, all_baselines=True) 369 test_baselines = test_config.test_port.expected_baselines(test_path, baseline_extension) 370 baselines = all_platforms_port.expected_baselines(test_path, baseline_extension, all_baselines=True) 374 371 for platform_directory, expected_filename in baselines: 375 372 if not platform_directory: … … 378 375 platform = 'base' 379 376 else: 380 platform = all_platforms_port.platform_from_directory( 381 platform_directory) 377 platform = all_platforms_port.platform_from_directory(platform_directory) 382 378 platform_baselines = all_test_baselines.setdefault(platform, {}) 383 was_used_for_test = ( 384 platform_directory, expected_filename) in test_baselines 379 was_used_for_test = (platform_directory, expected_filename) in test_baselines 385 380 platform_baselines[baseline_extension] = was_used_for_test 386 381 -
trunk/Tools/Scripts/webkitpy/tool/commands/rebaselineserver_unittest.py
r90076 r90077 292 292 293 293 class TestMacPort(WebKitPort): 294 port_name = "mac" 294 295 def __init__(self): 295 296 # FIXME: This should use MockExecutive and MockUser as well. 296 297 WebKitPort.__init__(self, filesystem=mock_filesystem) 297 self._name = 'mac'298 298 299 299 return rebaselineserver.TestConfig(
Note: See TracChangeset
for help on using the changeset viewer.