WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-76215-20120112143802.patch (text/plain), 50.05 KB, created by
Dirk Pranke
on 2012-01-12 14:38:03 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dirk Pranke
Created:
2012-01-12 14:38:03 PST
Size:
50.05 KB
patch
obsolete
>Subversion Revision: 104843 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 24c24432436e1350b636ce745b1c83bc342389fc..1049b625fdefb3e49e34d036052af71f3ddf830e 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,5 +1,112 @@ > 2012-01-12 Dirk Pranke <dpranke@chromium.org> > >+ webkitpy: make mapping a port name to a port completely data-driven >+ https://bugs.webkit.org/show_bug.cgi?id=76215 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This change completes the removal of version-parsing logic from >+ the port constructors and makes the PortFactory logic completely >+ data driven. Each Port class is now required to implement a >+ 'port_name' field that will match the start of all ports >+ constructed by this class and a 'determine_full_port_name' field >+ that will make the port fully-qualified. Everything else becomes >+ a table lookup. >+ >+ * Scripts/webkitpy/layout_tests/port/apple.py: >+ (ApplePort.__init__): >+ * Scripts/webkitpy/layout_tests/port/base.py: >+ (Port): >+ (Port.determine_port_name): >+ (Port.__init__): >+ * Scripts/webkitpy/layout_tests/port/chromium.py: >+ (ChromiumPort.for): >+ (ChromiumPort.__init__): >+ (ChromiumPort): >+ (ChromiumPort._chromium_base_dir): >+ (ChromiumPort.path_from_chromium_base): >+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py: >+ (ChromiumGpuLinuxPort): >+ (ChromiumGpuLinuxPort.__init__): >+ (ChromiumGpuMacPort): >+ (ChromiumGpuMacPort.__init__): >+ (ChromiumGpuWinPort): >+ (ChromiumGpuWinPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py: >+ (ChromiumLinuxPort): >+ (ChromiumLinuxPort.determine_port_name): >+ (ChromiumLinuxPort._determine_driver_path_statically): >+ (ChromiumLinuxPort._static_build_path): >+ (ChromiumLinuxPort._determine_architecture): >+ (ChromiumLinuxPort.__init__): >+ (ChromiumLinuxPort._build_path): >+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py: >+ (ChromiumMacPort): >+ (ChromiumMacPort.determine_port_name): >+ (ChromiumMacPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/chromium_win.py: >+ (ChromiumWinPort): >+ (ChromiumWinPort.determine_port_name): >+ (ChromiumWinPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/dryrun.py: >+ (DryRunPort): >+ (DryRunPort.determine_port_name): >+ (DryRunPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/efl.py: >+ (EflPort): >+ * Scripts/webkitpy/layout_tests/port/factory.py: >+ (PortFactory): >+ (PortFactory._default_port): >+ (PortFactory.get): >+ (PortFactory.get.in): >+ * Scripts/webkitpy/layout_tests/port/factory_unittest.py: >+ (FactoryTest.assert_port): >+ * Scripts/webkitpy/layout_tests/port/google_chrome.py: >+ (GoogleChromeLinux32Port): >+ (GoogleChromeLinux32Port.determine_port_name): >+ (GoogleChromeLinux64Port): >+ (GoogleChromeLinux64Port.determine_port_name): >+ (GoogleChromeMacPort): >+ (GoogleChromeMacPort.determine_port_name): >+ (GoogleChromeWinPort): >+ (GoogleChromeWinPort.determine_port_name): >+ * Scripts/webkitpy/layout_tests/port/gtk.py: >+ (GtkPort): >+ * Scripts/webkitpy/layout_tests/port/mac.py: >+ (MacPort): >+ (MacPort.determine_port_name): >+ (MacPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py: >+ (test_versions): >+ * Scripts/webkitpy/layout_tests/port/mock_drt.py: >+ (MockDRTPort): >+ (MockDRTPort.determine_port_name): >+ (MockDRTPort.__init__): >+ (MockDRT): >+ (MockDRT.determine_port_name): >+ * Scripts/webkitpy/layout_tests/port/port_testcase.py: >+ (PortTestCase.make_port): >+ * Scripts/webkitpy/layout_tests/port/qt.py: >+ (QtPort): >+ (QtPort.determine_port_name): >+ (QtPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/test.py: >+ (TestPort): >+ (TestPort.determine_port_name): >+ (TestPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/webkit.py: >+ (WebKitPort.__init__): >+ * Scripts/webkitpy/layout_tests/port/win.py: >+ (WinPort): >+ (WinPort.determine_port_name): >+ * Scripts/webkitpy/tool/servers/rebaselineserver.py: >+ (get_test_baselines.AllPlatformsPort.__init__): >+ * Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py: >+ (get_test_config.TestMacPort): >+ (get_test_config): >+ >+2012-01-12 Dirk Pranke <dpranke@chromium.org> >+ > webkitpy: clean up port unit tests in preparation for making port_name mandatory > https://bugs.webkit.org/show_bug.cgi?id=76123 > >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/apple.py b/Tools/Scripts/webkitpy/layout_tests/port/apple.py >index c238ca3e4fc8a39b3109cf9f68f344e1f11769ac..c72e6fdea757aa0551188914a76f0a973f58a919 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/apple.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/apple.py >@@ -56,23 +56,12 @@ class ApplePort(WebKitPort): > # instead of the individual port constructors. > return port_name[len(self.port_name + '-'):] > >- def __init__(self, host, port_name=None, **kwargs): >- port_name = port_name or self.port_name >- WebKitPort.__init__(self, host, port_name=port_name, **kwargs) >+ def __init__(self, host, port_name, **kwargs): >+ WebKitPort.__init__(self, host, port_name, **kwargs) > >- # FIXME: This sort of parsing belongs in factory.py! >- if port_name == '%s-wk2' % self.port_name: >- port_name = self.port_name >- # FIXME: This may be wrong, since options is a global property, and the port_name is specific to this object? >- self.set_option_default('webkit_test_runner', True) >- >- if port_name == self.port_name: >- self._version = host.platform.os_version >- self._name = self.port_name + '-' + self._version >- else: >- allowed_port_names = self.VERSION_FALLBACK_ORDER + [self.operating_system() + "-future"] >- assert port_name in allowed_port_names, "%s is not in %s" % (port_name, allowed_port_names) >- self._version = self._strip_port_name_prefix(port_name) >+ allowed_port_names = self.VERSION_FALLBACK_ORDER + [self.operating_system() + "-future"] >+ assert port_name in allowed_port_names, "%s is not in %s" % (port_name, allowed_port_names) >+ self._version = self._strip_port_name_prefix(port_name) > > # FIXME: A more sophisitcated version of this function should move to WebKitPort and replace all calls to name(). > def _port_name_with_version(self): >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/base.py b/Tools/Scripts/webkitpy/layout_tests/port/base.py >index 48c78da20c05d654d473a2ae41cfe1009265da0e..158eda20df95d39e5eb47dfd2678bc13b9081839 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/port/base.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/base.py >@@ -81,17 +81,31 @@ class DummyOptions(object): > class Port(object): > """Abstract class for Port-specific hooks for the layout_test package.""" > >- port_name = None # Subclasses override this >+ # Subclasses override this. This should indicate the basic implementation >+ # part of the port name, e.g., 'chromium-mac', 'win', 'gtk'; there is probably (?) >+ # one unique value per class. >+ >+ # FIXME: We should probably rename this to something like 'implementation_name'. >+ port_name = None > > # Test names resemble unix relative paths, and use '/' as a directory separator. > TEST_PATH_SEPARATOR = '/' > > ALL_BUILD_TYPES = ('debug', 'release') > >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ """Return a fully-specified port name that can be used to construct objects.""" >+ # Subclasses will usually override this. >+ return cls.port_name >+ > def __init__(self, host, port_name=None, options=None, config=None, **kwargs): > >+ # This value may be different from cls.port_name by having version modifiers >+ # and other fields appended to it (for example, 'qt-arm' or 'mac-wk2'). >+ self._name = port_name or self.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. > self._version = '' > self._architecture = 'x86' > self._graphics_type = 'cpu' >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py >index a6f61123de526d91e22eebddfc668618c0a4bd87..e2aad13f6cf387af9727ecf6ccfcbf02bf318c2c 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium.py >@@ -58,8 +58,6 @@ _log = logging.getLogger(__name__) > class ChromiumPort(Port): > """Abstract base class for Chromium implementations of the Port class.""" > >- port_name = "chromium" >- > ALL_SYSTEMS = ( > ('leopard', 'x86'), > ('snowleopard', 'x86'), >@@ -85,11 +83,9 @@ class ChromiumPort(Port): > 'linux': ['lucid'], > } > >- def __init__(self, host, **kwargs): >- Port.__init__(self, host, **kwargs) >- # All sub-classes override this, but we need an initial value for testing. >- self._version = 'xp' >- self._chromium_base_dir = None >+ def __init__(self, host, port_name, **kwargs): >+ Port.__init__(self, host, port_name, **kwargs) >+ self._chromium_base_dir_path = None > > def _check_file_exists(self, path_to_file, file_description, > override_step=None, logging=True): >@@ -217,17 +213,22 @@ class ChromiumPort(Port): > self._filesystem.rmtree(str(tempdir)) > return (result, 0) # FIXME: how to get % diff? > >+ @classmethod >+ def _chromium_base_dir(cls, filesystem, *comps): >+ module_path = filesystem.path_to_module(cls.__module__) >+ offset = module_path.find('third_party') >+ if offset == -1: >+ return filesystem.join(module_path[0:module_path.find('Tools')], 'Source', 'WebKit', 'chromium') >+ else: >+ return module_path[0:offset] >+ >+ > def path_from_chromium_base(self, *comps): > """Returns the full path to path made by joining the top of the > Chromium source tree and the list of path components in |*comps|.""" >- if not self._chromium_base_dir: >- chromium_module_path = self._filesystem.path_to_module(self.__module__) >- offset = chromium_module_path.find('third_party') >- if offset == -1: >- self._chromium_base_dir = self._filesystem.join(chromium_module_path[0:chromium_module_path.find('Tools')], 'Source', 'WebKit', 'chromium') >- else: >- self._chromium_base_dir = chromium_module_path[0:offset] >- return self._filesystem.join(self._chromium_base_dir, *comps) >+ if not self._chromium_base_dir_path: >+ self._chromium_base_dir_path = self._chromium_base_dir(self._filesystem) >+ return self._filesystem.join(self._chromium_base_dir_path, *comps) > > def path_to_test_expectations_file(self): > return self.path_from_webkit_base('LayoutTests', 'platform', 'chromium', 'test_expectations.txt') >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py >index 8b4145e20401006664164223a316ac879e8719e1..fdc1117c96fda240e7b4b4401bd8581f2ea23644 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py >@@ -71,8 +71,10 @@ def _default_tests_paths(port): > > > class ChromiumGpuLinuxPort(chromium_linux.ChromiumLinuxPort): >- def __init__(self, host, port_name='chromium-gpu-linux', **kwargs): >- chromium_linux.ChromiumLinuxPort.__init__(self, host, port_name=port_name, **kwargs) >+ port_name = 'chromium-gpu-linux' >+ >+ def __init__(self, host, port_name, **kwargs): >+ chromium_linux.ChromiumLinuxPort.__init__(self, host, port_name, **kwargs) > _set_gpu_options(self) > > def baseline_search_path(self): >@@ -86,8 +88,10 @@ class ChromiumGpuLinuxPort(chromium_linux.ChromiumLinuxPort): > > > class ChromiumGpuMacPort(chromium_mac.ChromiumMacPort): >- def __init__(self, host, port_name='chromium-gpu-mac', **kwargs): >- chromium_mac.ChromiumMacPort.__init__(self, host, port_name=port_name, **kwargs) >+ port_name = 'chromium-gpu-mac' >+ >+ def __init__(self, host, port_name, **kwargs): >+ chromium_mac.ChromiumMacPort.__init__(self, host, port_name, **kwargs) > _set_gpu_options(self) > > def baseline_search_path(self): >@@ -100,8 +104,10 @@ class ChromiumGpuMacPort(chromium_mac.ChromiumMacPort): > > > class ChromiumGpuWinPort(chromium_win.ChromiumWinPort): >- def __init__(self, host, port_name='chromium-gpu-win', **kwargs): >- chromium_win.ChromiumWinPort.__init__(self, host, port_name=port_name, **kwargs) >+ port_name = 'chromium-gpu-win' >+ >+ def __init__(self, host, port_name, **kwargs): >+ chromium_win.ChromiumWinPort.__init__(self, host, port_name, **kwargs) > _set_gpu_options(self) > > def baseline_search_path(self): >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py >index 6b6e8ef494b06fa57f477f44c35a47161d8a2176..a645f1d780db21883cdf681519bf34d9139ba0dc 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_linux.py >@@ -28,13 +28,17 @@ > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > import logging >-import chromium >+ >+from webkitpy.layout_tests.port import chromium >+from webkitpy.layout_tests.port import config > > > _log = logging.getLogger(__name__) > > > class ChromiumLinuxPort(chromium.ChromiumPort): >+ port_name = 'chromium-linux' >+ > SUPPORTED_ARCHITECTURES = ('x86', 'x86_64') > > FALLBACK_PATHS = { >@@ -55,33 +59,39 @@ class ChromiumLinuxPort(chromium.ChromiumPort): > ], > } > >- def __init__(self, host, port_name=None, **kwargs): >- port_name = port_name or 'chromium-linux' >- chromium.ChromiumPort.__init__(self, host, 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. >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): > if port_name.endswith('-linux'): >- self._architecture = self._determine_architecture() >- # FIXME: This is an ugly hack to avoid renaming the GPU port. >- if port_name == 'chromium-linux': >- port_name = port_name + '-' + self._architecture >- else: >- base, arch = port_name.rsplit('-', 1) >- assert base in ('chromium-linux', 'chromium-gpu-linux') >- self._architecture = arch >- assert self._architecture in self.SUPPORTED_ARCHITECTURES >- assert port_name in ('chromium-linux', 'chromium-gpu-linux', >- 'chromium-linux-x86', 'chromium-linux-x86_64', >- 'chromium-gpu-linux-x86_64') >- self._name = port_name >- self._version = 'lucid' # We only support lucid right now. >- >- def _determine_architecture(self): >- driver_path = self._path_to_driver() >+ return port_name + '-' + cls._determine_architecture(host.filesystem, host.executive, cls._determine_driver_path_statically(host, options)) >+ return port_name >+ >+ @classmethod >+ def _determine_driver_path_statically(cls, host, options): >+ config_object = config.Config(host.executive, host.filesystem) >+ build_directory = getattr(options, 'build_directory', None) >+ webkit_base = config_object.path_from_webkit_base() >+ chromium_base = cls._chromium_base_dir(host.filesystem) >+ configuration = getattr(options, 'configuration', config_object.default_configuration()) >+ return cls._static_build_path(host.filesystem, build_directory, chromium_base, webkit_base, configuration, 'DumpRenderTree') >+ >+ @staticmethod >+ def _static_build_path(filesystem, build_directory, chromium_base, webkit_base, *comps): >+ if build_directory: >+ return filesystem.join(build_directory, *comps) >+ if filesystem.exists(filesystem.join(chromium_base, 'sconsbuild')): >+ return filesystem.join(chromium_base, 'sconsbuild', *comps) >+ if filesystem.exists(filesystem.join(chromium_base, 'out', *comps)): >+ return filesystem.join(chromium_base, 'out', *comps) >+ if filesystem.exists(filesystem.join(webkit_base, 'sconsbuild')): >+ return filesystem.join(webkit_base, 'sconsbuild', *comps) >+ return filesystem.join(webkit_base, 'out', *comps) >+ >+ @staticmethod >+ def _determine_architecture(filesystem, executive, driver_path): > file_output = '' >- if self._filesystem.exists(driver_path): >+ if filesystem.exists(driver_path): > # The --dereference flag tells file to follow symlinks >- file_output = self._executive.run_command(['file', '--dereference', driver_path], return_stderr=True) >+ file_output = executive.run_command(['file', '--dereference', driver_path], return_stderr=True) > > if 'ELF 32-bit LSB executable' in file_output: > return 'x86' >@@ -96,6 +106,17 @@ class ChromiumLinuxPort(chromium.ChromiumPort): > # if we actually try to use the binary, check_build() should fail. > return 'x86_64' > >+ def __init__(self, host, port_name, **kwargs): >+ chromium.ChromiumPort.__init__(self, host, port_name, **kwargs) >+ (base, arch) = port_name.rsplit('-', 1) >+ assert base in ('chromium-linux', 'chromium-gpu-linux') >+ assert arch in self.SUPPORTED_ARCHITECTURES >+ assert port_name in ('chromium-linux', 'chromium-gpu-linux', >+ 'chromium-linux-x86', 'chromium-linux-x86_64', >+ 'chromium-gpu-linux-x86_64') >+ self._version = 'lucid' # We only support lucid right now. >+ self._architecture = arch >+ > def baseline_search_path(self): > port_names = self.FALLBACK_PATHS[self._architecture] > return map(self._webkit_baseline_path, port_names) >@@ -118,18 +139,7 @@ class ChromiumLinuxPort(chromium.ChromiumPort): > # > > def _build_path(self, *comps): >- if self.get_option('build_directory'): >- return self._filesystem.join(self.get_option('build_directory'), *comps) >- >- base = self.path_from_chromium_base() >- if self._filesystem.exists(self._filesystem.join(base, 'sconsbuild')): >- return self._filesystem.join(base, 'sconsbuild', *comps) >- if self._filesystem.exists(self._filesystem.join(base, 'out', *comps)): >- return self._filesystem.join(base, 'out', *comps) >- base = self.path_from_webkit_base() >- if self._filesystem.exists(self._filesystem.join(base, 'sconsbuild')): >- return self._filesystem.join(base, 'sconsbuild', *comps) >- return self._filesystem.join(base, 'out', *comps) >+ return self._static_build_path(self._filesystem, self.get_option('build_directory'), self.path_from_chromium_base(), self.path_from_webkit_base(), *comps) > > def _check_apache_install(self): > result = self._check_file_exists(self._path_to_apache(), "apache2") >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py >index 41a1a555ae2cb5fe8e74a0e19bae97fe792efd74..56519425797cd533699d319193250aff59a4f3bf 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_mac.py >@@ -39,7 +39,7 @@ _log = logging.getLogger(__name__) > > > class ChromiumMacPort(chromium.ChromiumPort): >- SUPPORTED_OS_VERSIONS = ('leopard', 'snowleopard', 'lion', 'future') >+ port_name = 'chromium-mac' > > FALLBACK_PATHS = { > 'leopard': [ >@@ -73,18 +73,19 @@ class ChromiumMacPort(chromium.ChromiumPort): > ], > } > >- def __init__(self, host, port_name=None, os_version_string=None, **kwargs): >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ if port_name.endswith('-mac'): >+ return port_name + '-' + host.platform.os_version >+ return port_name >+ >+ def __init__(self, host, port_name, **kwargs): >+ chromium.ChromiumPort.__init__(self, host, port_name, **kwargs) >+ > # We're a little generic here because this code is reused by the > # 'google-chrome' port as well as the 'mock-' and 'dryrun-' ports. >- port_name = port_name or 'chromium-mac' >- chromium.ChromiumPort.__init__(self, host, port_name=port_name, **kwargs) >- if port_name.endswith('-mac'): >- assert host.platform.is_mac() >- self._version = host.platform.os_version >- self._name = port_name + '-' + self._version >- else: >- self._version = port_name[port_name.index('-mac-') + len('-mac-'):] >- assert self._version in self.SUPPORTED_OS_VERSIONS >+ self._version = port_name[port_name.index('-mac-') + len('-mac-'):] >+ assert self._version in self.FALLBACK_PATHS > > def baseline_search_path(self): > fallback_paths = self.FALLBACK_PATHS >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py >index 0b6e4974b49d860c6b3cb8414ee4f70f632d7281..4e79fb8c8a999d5898c764d168ceba85f7ac2b6e 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/chromium_win.py >@@ -39,6 +39,8 @@ _log = logging.getLogger(__name__) > > > class ChromiumWinPort(chromium.ChromiumPort): >+ port_name = 'chromium-win' >+ > # FIXME: Figure out how to unify this with base.TestConfiguration.all_systems()? > SUPPORTED_VERSIONS = ('xp', 'vista', 'win7') > >@@ -67,22 +69,24 @@ class ChromiumWinPort(chromium.ChromiumPort): > ], > } > >- def __init__(self, host, port_name=None, windows_version=None, **kwargs): >- # We're a little generic here because this code is reused by the >- # 'google-chrome' port as well as the 'mock-' and 'dryrun-' ports. >- port_name = port_name or 'chromium-win' >- chromium.ChromiumPort.__init__(self, host, port_name=port_name, **kwargs) >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): > if port_name.endswith('-win'): > assert host.platform.is_win() > if host.platform.os_version in ('7sp0', '7sp1', 'future'): >- self._version = 'win7' >+ version = 'win7' > else: >- self._version = host.platform.os_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) >+ version = host.platform.os_version >+ port_name = port_name + '-' + version >+ return port_name > >+ def __init__(self, host, port_name, **kwargs): >+ chromium.ChromiumPort.__init__(self, host, port_name, **kwargs) >+ >+ # We're a little generic here because this code is reused by the >+ # 'google-chrome' port as well as the 'mock-' and 'dryrun-' ports. >+ 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) > > def setup_environ_for_server(self, server_name=None): > env = chromium.ChromiumPort.setup_environ_for_server(self, server_name) >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/dryrun.py b/Tools/Scripts/webkitpy/layout_tests/port/dryrun.py >index a48d07461217b79e5848ba926ce523bb710d0bb6..994c275226db0c2c0b3a44987e6de1bba97afa31 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/dryrun.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/dryrun.py >@@ -44,10 +44,6 @@ > This implementation also modifies the test expectations so that all > tests are either SKIPPED or expected to PASS.""" > >-from __future__ import with_statement >- >-import os >-import sys > import time > > from webkitpy.layout_tests.port import Driver, DriverOutput, factory >@@ -58,15 +54,16 @@ from webkitpy.layout_tests.port import Driver, DriverOutput, factory > # all of the methods are passed to the __delegate, not to the base class. > class DryRunPort(object): > """DryRun implementation of the Port interface.""" >+ port_name = 'dryrun' >+ >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ """Return a fully-specified port name that can be used to construct objects.""" >+ # Subclasses will usually override this. >+ return port_name > >- def __init__(self, host, **kwargs): >- pfx = 'dryrun-' >- if 'port_name' in kwargs: >- if kwargs['port_name'].startswith(pfx): >- kwargs['port_name'] = kwargs['port_name'][len(pfx):] >- else: >- kwargs['port_name'] = None >- self.__delegate = factory.PortFactory(host).get(**kwargs) >+ def __init__(self, host, port_name, **kwargs): >+ self.__delegate = factory.PortFactory(host).get(port_name.replace('dryrun-', ''), **kwargs) > > def __getattr__(self, name): > return getattr(self.__delegate, name) >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/efl.py b/Tools/Scripts/webkitpy/layout_tests/port/efl.py >index 3ac71d571478f3883a1d0ddcd670d7be31a5e9d8..a4b70a378961eb91b1a1e3f41b859e642f17986a 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/efl.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/efl.py >@@ -38,11 +38,7 @@ _log = logging.getLogger(__name__) > > > class EflPort(WebKitPort): >- port_name = "efl" >- >- def __init__(self, host, **kwargs): >- WebKitPort.__init__(self, host, **kwargs) >- self._version = self.port_name >+ port_name = 'efl' > > def _port_flag_for_scripts(self): > return "--efl" >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/Tools/Scripts/webkitpy/layout_tests/port/factory.py >index 709500d355e702306ad3181a5ba240916ece78fe..f0127b067a665e2958c3a3da4b681fed2d4a4601 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/factory.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory.py >@@ -41,103 +41,60 @@ class BuilderOptions(object): > > > class PortFactory(object): >+ PORT_CLASSES = ( >+ 'chromium_gpu.ChromiumGpuLinuxPort', >+ 'chromium_gpu.ChromiumGpuMacPort', >+ 'chromium_gpu.ChromiumGpuWinPort', >+ 'chromium_linux.ChromiumLinuxPort', >+ 'chromium_mac.ChromiumMacPort', >+ 'chromium_win.ChromiumWinPort', >+ 'dryrun.DryRunPort', >+ 'efl.EflPort', >+ 'google_chrome.GoogleChromeLinux32Port', >+ 'google_chrome.GoogleChromeLinux64Port', >+ 'google_chrome.GoogleChromeMacPort', >+ 'google_chrome.GoogleChromeWinPort', >+ 'gtk.GtkPort', >+ 'mac.MacPort', >+ 'mock_drt.MockDRTPort', >+ 'qt.QtPort', >+ 'test.TestPort', >+ 'win.WinPort', >+ ) >+ > def __init__(self, host): > self._host = host > >- def _port_name_from_arguments_and_options(self, port_name, options, platform): >- if port_name == 'chromium-gpu': >- if platform.is_win(): >- return 'chromium-gpu-win' >- if platform.is_linux(): >- return 'chromium-gpu-linux' >- if platform.is_mac(): >- return 'chromium-gpu-mac' >- >- if port_name: >- return port_name >- >- if platform.is_win(): >- if options and hasattr(options, 'chromium') and options.chromium: >- return 'chromium-win' >- return 'win' >- if platform.is_linux(): >+ def _default_port(self, options): >+ platform = self._host.platform >+ if options and hasattr(options, 'chromium') and options.chromium: >+ return 'chromium-' + platform.os_name >+ elif platform.is_linux(): > return 'chromium-linux' >- if platform.is_mac(): >- if options and hasattr(options, 'chromium') and options.chromium: >- return 'chromium-mac' >+ elif platform.is_mac(): > return 'mac' >- >- raise NotImplementedError('unknown port; os_name = "%s"' % platform.os_name) >+ elif platform.is_win(): >+ return 'win' >+ raise NotImplementedError('unknown platform: %s' % platform) > > def get(self, port_name=None, options=None, **kwargs): > """Returns an object implementing the Port interface. If > port_name is None, this routine attempts to guess at the most > appropriate port on this platform.""" >- port_to_use = self._port_name_from_arguments_and_options(port_name, options, self._host.platform) >- if port_to_use.startswith('test'): >- import test >- maker = test.TestPort >- elif port_to_use.startswith('dryrun'): >- import dryrun >- maker = dryrun.DryRunPort >- elif port_to_use.startswith('mock-'): >- import mock_drt >- maker = mock_drt.MockDRTPort >- elif port_to_use.startswith('mac'): >- import mac >- maker = mac.MacPort >- elif port_to_use.startswith('win'): >- import win >- maker = win.WinPort >- elif port_to_use.startswith('gtk'): >- import gtk >- maker = gtk.GtkPort >- elif port_to_use.startswith('qt'): >- import qt >- maker = qt.QtPort >- elif port_to_use.startswith('chromium-gpu-linux'): >- import chromium_gpu >- port_name = port_to_use >- maker = chromium_gpu.ChromiumGpuLinuxPort >- elif port_to_use.startswith('chromium-gpu-mac'): >- import chromium_gpu >- port_name = port_to_use >- maker = chromium_gpu.ChromiumGpuMacPort >- elif port_to_use.startswith('chromium-gpu-win'): >- import chromium_gpu >- port_name = port_to_use >- maker = chromium_gpu.ChromiumGpuWinPort >- elif port_to_use.startswith('chromium-mac'): >- import chromium_mac >- port_name = port_to_use >- maker = chromium_mac.ChromiumMacPort >- elif port_to_use.startswith('chromium-linux'): >- import chromium_linux >- maker = chromium_linux.ChromiumLinuxPort >- elif port_to_use.startswith('chromium-win'): >- import chromium_win >- maker = chromium_win.ChromiumWinPort >- elif port_to_use == 'google-chrome-linux32': >- import google_chrome >- port_name = 'chromium-linux-x86' >- maker = google_chrome.GoogleChromeLinux32Port >- elif port_to_use == 'google-chrome-linux64': >- import google_chrome >- port_name = 'chromium-linux-x86_64' >- maker = google_chrome.GoogleChromeLinux64Port >- elif port_to_use.startswith('google-chrome-win'): >- import google_chrome >- maker = google_chrome.GoogleChromeWinPort >- elif port_to_use.startswith('google-chrome-mac'): >- import google_chrome >- maker = google_chrome.GoogleChromeMacPort >- elif port_to_use.startswith('efl'): >- import efl >- maker = efl.EflPort >- else: >- raise NotImplementedError('unsupported port: %s' % port_to_use) >+ port_name = port_name or self._default_port(options) > >- return maker(self._host, port_name=port_name, options=options, **kwargs) >+ # FIXME: Remove this when we remove the chromium-gpu ports. >+ if port_name == 'chromium-gpu': >+ port_name = port_name + '-' + self._host.platform.os_name >+ >+ for port_class in self.PORT_CLASSES: >+ module_name, class_name = port_class.rsplit('.', 1) >+ module = __import__(module_name, globals(), locals(), [], -1) >+ cls = module.__dict__[class_name] >+ if port_name.startswith(cls.port_name): >+ port_name = cls.determine_full_port_name(self._host, options, port_name) >+ return cls(self._host, port_name, options=options, **kwargs) >+ raise NotImplementedError('unsupported port: %s' % port_name) > > def all_port_names(self): > """Return a list of all valid, fully-specified, "real" port names. >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py >index 1b1ff3f3fcb92fbb77d83189f6f8ff838e3fa4cd..7bfa8c8e00a6e6a35cfda9fe263d42bbcf03a4b5 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py >@@ -58,6 +58,7 @@ class FactoryTest(unittest.TestCase): > host = MockSystemHost(os_name=os_name, os_version=os_version) > port = PortFactory(host).get(port_name, options=options) > self.assertTrue(isinstance(port, cls)) >+ self.assertEquals(port.__class__.__name__, cls.__name__) > > def test_mac(self): > self.assert_port(port_name='mac', cls=mac.MacPort) >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py b/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py >index 1d778312684f9a6261b52a5b31c31be467740ecf..51f83ded1d70aaa6a1a898b4536fb13ba70b06bc 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py >@@ -47,6 +47,13 @@ def _test_expectations_overrides(port, super): > > > class GoogleChromeLinux32Port(chromium_linux.ChromiumLinuxPort): >+ port_name = 'google-chrome-linux32' >+ >+ # FIXME: Make google-chrome-XXX work as a port name. >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ return 'chromium-linux-x86' >+ > def baseline_search_path(self): > paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self) > paths.insert(0, self._webkit_baseline_path('google-chrome-linux32')) >@@ -60,6 +67,13 @@ class GoogleChromeLinux32Port(chromium_linux.ChromiumLinuxPort): > > > class GoogleChromeLinux64Port(chromium_linux.ChromiumLinuxPort): >+ port_name = 'google-chrome-linux64' >+ >+ # FIXME: Make google-chrome-XXX work as a port name. >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ return 'chromium-linux-x86_64' >+ > def baseline_search_path(self): > paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self) > paths.insert(0, self._webkit_baseline_path('google-chrome-linux64')) >@@ -73,6 +87,13 @@ class GoogleChromeLinux64Port(chromium_linux.ChromiumLinuxPort): > > > class GoogleChromeMacPort(chromium_mac.ChromiumMacPort): >+ port_name = 'google-chrome-mac' >+ >+ # FIXME: Make google-chrome-XXX work as a port name. >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ return 'chromium-mac-leopard' >+ > def baseline_search_path(self): > paths = chromium_mac.ChromiumMacPort.baseline_search_path(self) > paths.insert(0, self._webkit_baseline_path('google-chrome-mac')) >@@ -83,6 +104,13 @@ class GoogleChromeMacPort(chromium_mac.ChromiumMacPort): > > > class GoogleChromeWinPort(chromium_win.ChromiumWinPort): >+ port_name = 'google-chrome-win' >+ >+ # FIXME: Make google-chrome-XXX work as a port name. >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ return 'chromium-win-xp' >+ > def baseline_search_path(self): > paths = chromium_win.ChromiumWinPort.baseline_search_path(self) > paths.insert(0, self._webkit_baseline_path('google-chrome-win')) >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py >index 3f56304f1083f13f59efeded191456bf2bd73be0..6dedd2d706071ccdc4a49851cc6d26c801024adb 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/gtk.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/gtk.py >@@ -76,10 +76,6 @@ class GtkDriver(WebKitDriver): > class GtkPort(WebKitPort): > port_name = "gtk" > >- def __init__(self, host, **kwargs): >- WebKitPort.__init__(self, host, **kwargs) >- self._version = self.port_name >- > def _port_flag_for_scripts(self): > return "--gtk" > >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mac.py b/Tools/Scripts/webkitpy/layout_tests/port/mac.py >index c11c0a0a3a01748a5f18d135a90f5c46cce13467..a5f5084ec6e7bfb718bed9d3249824d4bca545fa 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/mac.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/mac.py >@@ -35,6 +35,7 @@ from webkitpy.layout_tests.port.leakdetector import LeakDetector > > _log = logging.getLogger(__name__) > >+ > class MacPort(ApplePort): > port_name = "mac" > >@@ -42,8 +43,19 @@ class MacPort(ApplePort): > # and the order of fallback between them. Matches ORWT. > VERSION_FALLBACK_ORDER = ["mac-leopard", "mac-snowleopard", "mac-lion", "mac"] > >- def __init__(self, host, **kwargs): >- ApplePort.__init__(self, host, **kwargs) >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ if port_name.endswith('-wk2'): >+ # FIXME: This may be wrong, since options is a global property, and the port_name is specific to this object? >+ if options and not hasattr(options, 'webkit_test_runner'): >+ options.webkit_test_runner = True >+ port_name = port_name.replace('-wk2', '') >+ if port_name.endswith('mac'): >+ return port_name + '-' + host.platform.os_version >+ return port_name >+ >+ def __init__(self, host, port_name, **kwargs): >+ ApplePort.__init__(self, host, port_name, **kwargs) > self._leak_detector = LeakDetector(self) > if self.get_option("leaks"): > # DumpRenderTree slows down noticably if we run more than about 1000 tests in a batch >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py >index 8965fb84c2a44a8fa9af486ded205a739528424b..73766296c4ec3708bb3c1585b767bd7e2a517ea3 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/mac_unittest.py >@@ -98,23 +98,19 @@ java/ > self.assertTrue(port.version()) > > def test_versions(self): >- self.assert_name(None, 'leopard', 'mac-leopard') > self.assert_name('mac', 'leopard', 'mac-leopard') > self.assert_name('mac-leopard', 'tiger', 'mac-leopard') > self.assert_name('mac-leopard', 'leopard', 'mac-leopard') > self.assert_name('mac-leopard', 'snowleopard', 'mac-leopard') > >- self.assert_name(None, 'snowleopard', 'mac-snowleopard') > self.assert_name('mac', 'snowleopard', 'mac-snowleopard') > self.assert_name('mac-snowleopard', 'tiger', 'mac-snowleopard') > self.assert_name('mac-snowleopard', 'leopard', 'mac-snowleopard') > self.assert_name('mac-snowleopard', 'snowleopard', 'mac-snowleopard') > >- self.assert_name(None, 'lion', 'mac-lion') > self.assert_name('mac', 'lion', 'mac-lion') > self.assert_name('mac-lion', 'lion', 'mac-lion') > >- self.assert_name(None, 'future', 'mac-future') > self.assert_name('mac', 'future', 'mac-future') > self.assert_name('mac-future', 'future', 'mac-future') > >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py b/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py >index d5359dec7950ca6147b31fc46c4bb841f543c5fa..f284e769fe923f7907da28fec74c6a8283f26376 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/mock_drt.py >@@ -50,14 +50,18 @@ _log = logging.getLogger(__name__) > > class MockDRTPort(object): > """MockPort implementation of the Port interface.""" >+ port_name = 'mock' > >- def __init__(self, host, **kwargs): >- prefix = 'mock-' >- if 'port_name' in kwargs: >- kwargs['port_name'] = kwargs['port_name'][len(prefix):] >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ """Return a fully-specified port name that can be used to construct objects.""" >+ # Subclasses will usually override this. >+ return port_name >+ >+ def __init__(self, host, port_name, **kwargs): >+ self.__delegate = PortFactory(host).get(port_name.replace('mock-', ''), **kwargs) >+ self.__real_name = port_name > self._host = host >- self.__delegate = PortFactory(host).get(**kwargs) >- self.__real_name = prefix + self.__delegate.name() > > def real_name(self): > return self.__real_name >@@ -174,6 +178,12 @@ class _DRTInput(object): > > > class MockDRT(object): >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ """Return a fully-specified port name that can be used to construct objects.""" >+ # Subclasses will usually override this. >+ return cls.port_name >+ > def __init__(self, options, args, host, stdin, stdout, stderr): > self._options = options > self._args = args >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py >index a021cbc98e637084433f59a4b79e8abfec659e3b..07b3657bbf3d94965c7d25107d3d89de95e92384 100755 >--- a/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/port_testcase.py >@@ -59,10 +59,12 @@ class PortTestCase(unittest.TestCase): > os_version = None > port_maker = None > >- def make_port(self, host=None, options=None, os_name=None, os_version=None, **kwargs): >+ def make_port(self, host=None, port_name=None, options=None, os_name=None, os_version=None, **kwargs): > host = host or MockSystemHost(os_name=(os_name or self.os_name), os_version=(os_version or self.os_version)) > options = options or MockOptions(configuration='Release') >- return self.port_maker(host, options=options, **kwargs) >+ port_name = port_name or self.port_name >+ port_name = self.port_maker.determine_full_port_name(host, options, port_name) >+ return self.port_maker(host, port_name=(port_name or self.port_name), options=options, **kwargs) > > def test_default_worker_model(self): > port = self.make_port() >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/qt.py b/Tools/Scripts/webkitpy/layout_tests/port/qt.py >index 701375e1e2b66f07080e0e71700c25ead6c52713..24458768c71836df23fed51d5b38673b7e872b80 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/qt.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/qt.py >@@ -49,23 +49,22 @@ class QtPort(WebKitPort): > def _port_flag_for_scripts(self): > return "--qt" > >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ if port_name and port_name != cls.port_name: >+ return port_name >+ return port_name + '-' + host.platform.os_name >+ > # sys_platform exists only for unit testing. >- def __init__(self, host, port_name=None, **kwargs): >- port_name = port_name or self.port_name >- WebKitPort.__init__(self, host, port_name=None, **kwargs) >- self._operating_system = host.platform.os_name >- self._version = self.operating_system() >+ def __init__(self, host, port_name, **kwargs): >+ WebKitPort.__init__(self, host, port_name, **kwargs) > > # FIXME: This will allow WebKitPort.baseline_search_path and WebKitPort._skipped_file_search_paths > # to do the right thing, but doesn't include support for qt-4.8 or qt-arm (seen in LayoutTests/platform) yet. >+ self._operating_system = port_name.replace('qt-', '') > >- if port_name != self.port_name: >- self._name = port_name >- else: >- name_components = [self.port_name] >- if self.operating_system(): >- name_components.append(self.operating_system()) >- self._name = "-".join(name_components) >+ # FIXME: Why is this being set at all? >+ self._version = self.operating_system() > > def _generate_all_test_configurations(self): > configurations = [] >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/test.py b/Tools/Scripts/webkitpy/layout_tests/port/test.py >index 0d51cf9012b87845f712e8afadfb9a5c6d8a6c42..314d9f02f0554cca7bbc7920bfc5970b550b05e9 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/test.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/test.py >@@ -28,7 +28,6 @@ > # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > > """Dummy Port implementation used for testing.""" >-from __future__ import with_statement > > import base64 > import sys >@@ -304,6 +303,8 @@ WONTFIX SKIP : failures/expected/exception.html = CRASH > > > class TestPort(Port): >+ port_name = 'test' >+ > """Test implementation of the Port interface.""" > ALL_BASELINE_VARIANTS = ( > 'test-mac-snowleopard', 'test-mac-leopard', >@@ -311,16 +312,21 @@ class TestPort(Port): > 'test-linux-x86_64', > ) > >- def __init__(self, host, port_name=None, **kwargs): >- if not port_name or port_name == 'test': >- port_name = 'test-mac-leopard' >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ if port_name == 'test': >+ return 'test-mac-leopard' >+ return port_name > >+ def __init__(self, host, port_name=None, **kwargs): >+ # FIXME: Consider updating all of the callers to pass in a port_name so it can be a >+ # required parameter like all of the other Port objects. >+ port_name = port_name or 'test-mac-leopard' >+ Port.__init__(self, host, port_name, **kwargs) > self._tests = unit_test_list() > self._expectations_path = LAYOUT_TEST_DIR + '/platform/test/test_expectations.txt' > self._results_directory = None > >- Port.__init__(self, host, port_name=port_name, **kwargs) >- > self._operating_system = 'mac' > if port_name.startswith('test-win'): > self._operating_system = 'win' >@@ -337,7 +343,6 @@ class TestPort(Port): > } > self._version = version_map[port_name] > >- > def _path_to_driver(self): > # This routine shouldn't normally be called, but it is called by > # the mock_drt Driver. We return something, but make sure it's useless. >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py >index cdd6af2d6b66608937a9e48d9b959b16e6c335ab..6bbdacc647bf264d4fc0c51a609a9f91f232226f 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/webkit.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/webkit.py >@@ -51,8 +51,8 @@ _log = logging.getLogger(__name__) > > > class WebKitPort(Port): >- def __init__(self, host, **kwargs): >- Port.__init__(self, host, **kwargs) >+ def __init__(self, host, port_name=None, **kwargs): >+ Port.__init__(self, host, port_name=port_name, **kwargs) > > # FIXME: Disable pixel tests until they are run by default on build.webkit.org. > self.set_option_default("pixel_tests", False) >diff --git a/Tools/Scripts/webkitpy/layout_tests/port/win.py b/Tools/Scripts/webkitpy/layout_tests/port/win.py >index 323bc1dbf3ceb9cdf93dd78265718278c70b3dc4..b2fbd358ca31114648954e946dc86f6240dd2d1d 100644 >--- a/Tools/Scripts/webkitpy/layout_tests/port/win.py >+++ b/Tools/Scripts/webkitpy/layout_tests/port/win.py >@@ -38,6 +38,7 @@ from webkitpy.layout_tests.port.apple import ApplePort > _log = logging.getLogger(__name__) > > >+ > class WinPort(ApplePort): > port_name = "win" > >@@ -45,6 +46,20 @@ class WinPort(ApplePort): > # and the order of fallback between them. Matches ORWT. > VERSION_FALLBACK_ORDER = ["win-xp", "win-vista", "win-7sp0", "win"] > >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ if port_name.endswith('-wk2'): >+ # FIXME: This may be wrong, since options is a global property, and the port_name is specific to this object? >+ if options and not hasattr(options, 'webkit_test_runner'): >+ options.webkit_test_runner = True >+ port_name = port_name.replace('-wk2', '') >+ if port_name.endswith('win'): >+ if host.platform.os_name != 'win': >+ return 'win' >+ return port_name + '-' + host.platform.os_version >+ return port_name >+ >+ > def compare_text(self, expected_text, actual_text): > # Sanity was restored in WK2, so we don't need this hack there. > if self.get_option('webkit_test_runner'): >diff --git a/Tools/Scripts/webkitpy/tool/servers/rebaselineserver.py b/Tools/Scripts/webkitpy/tool/servers/rebaselineserver.py >index 39c5b9e551da1ef0ea90681c494c95559ac8a35a..15bcd6f559431b5e616ed74650428f9e64eb116a 100644 >--- a/Tools/Scripts/webkitpy/tool/servers/rebaselineserver.py >+++ b/Tools/Scripts/webkitpy/tool/servers/rebaselineserver.py >@@ -165,7 +165,7 @@ def get_test_baselines(test_file, test_config): > # FIXME: This seems like a hack. This only seems used to access the Port.expected_baselines logic. > class AllPlatformsPort(WebKitPort): > def __init__(self, host): >- WebKitPort.__init__(self, host) >+ WebKitPort.__init__(self, host, 'mac') > self._platforms_by_directory = dict([(self._webkit_baseline_path(p), p) for p in test_config.platforms]) > > def baseline_search_path(self): >diff --git a/Tools/Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py b/Tools/Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py >index 30d1e66100d728478ab84af75a5473bee49d0a7e..0b9bc43afd4be49488436ee12a2fd47c4244de6a 100644 >--- a/Tools/Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py >+++ b/Tools/Scripts/webkitpy/tool/servers/rebaselineserver_unittest.py >@@ -310,11 +310,8 @@ def get_test_config(test_files=[], result_files=[]): > class TestMacPort(WebKitPort): > port_name = "mac" > >- def __init__(self, host): >- WebKitPort.__init__(self, host, port_name=self.port_name) >- > return TestConfig( >- TestMacPort(host), >+ TestMacPort(host, 'mac'), > layout_tests_directory, > results_directory, > ('mac', 'mac-leopard', 'win', 'linux'),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 76215
:
122312