Diff
Modified: trunk/Tools/ChangeLog (104165 => 104166)
--- trunk/Tools/ChangeLog 2012-01-05 16:00:06 UTC (rev 104165)
+++ trunk/Tools/ChangeLog 2012-01-05 16:39:40 UTC (rev 104166)
@@ -1,3 +1,44 @@
+2012-01-05 Alpha Lam <[email protected]>
+
+ Unreviewed, rolling out r104159.
+ http://trac.webkit.org/changeset/104159
+ https://bugs.webkit.org/show_bug.cgi?id=75590
+
+ Chromium port GPU tests cannot be executed.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ (get):
+ (_default_tests_paths):
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
+ (ChromiumGpuTest.assert_port_works):
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ (PortFactory._port_name_from_arguments_and_options):
+ (PortFactory):
+ (PortFactory._get_kwargs):
+ (PortFactory.get):
+ * Scripts/webkitpy/layout_tests/port/factory_unittest.py:
+ (FactoryTest.test_google_chrome.names):
+ (FactoryTest.test_google_chrome):
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py:
+ (GetGoogleChromePort):
+ (GetGoogleChromePort.GoogleChromeLinux32Port):
+ (GetGoogleChromePort.GoogleChromeLinux32Port.baseline_search_path):
+ (GetGoogleChromePort.GoogleChromeLinux32Port.test_expectations_overrides):
+ (GetGoogleChromePort.GoogleChromeLinux32Port.architecture):
+ (GetGoogleChromePort.GoogleChromeLinux64Port):
+ (GetGoogleChromePort.GoogleChromeLinux64Port.baseline_search_path):
+ (GetGoogleChromePort.GoogleChromeLinux64Port.test_expectations_overrides):
+ (GetGoogleChromePort.GoogleChromeLinux64Port.architecture):
+ (GetGoogleChromePort.GoogleChromeMacPort):
+ (GetGoogleChromePort.GoogleChromeMacPort.baseline_search_path):
+ (GetGoogleChromePort.GoogleChromeMacPort.test_expectations_overrides):
+ (GetGoogleChromePort.GoogleChromeWinPort):
+ (GetGoogleChromePort.GoogleChromeWinPort.baseline_search_path):
+ (GetGoogleChromePort.GoogleChromeWinPort.test_expectations_overrides):
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
+ (GetGoogleChromePortTest._verify_baseline_path):
+ (GetGoogleChromePortTest._verify_expectations_overrides):
+
2012-01-05 Dirk Pranke <[email protected]>
webkitpy: clean up port factory methods
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py (104165 => 104166)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py 2012-01-05 16:00:06 UTC (rev 104165)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py 2012-01-05 16:39:40 UTC (rev 104166)
@@ -31,8 +31,34 @@
import chromium_win
-# FIXME: This whole file needs to go away and we need to eliminate the GPU configuration.
+def get(host, platform=None, port_name='chromium-gpu', **kwargs):
+ """Some tests have slightly different results when run while using
+ hardware acceleration. In those cases, we prepend an additional directory
+ to the baseline paths."""
+ platform = platform or sys.platform
+ if port_name == 'chromium-gpu':
+ if platform in ('cygwin', 'win32'):
+ port_name = 'chromium-gpu-win'
+ elif platform.startswith('linux'):
+ port_name = 'chromium-gpu-linux'
+ elif platform == 'darwin':
+ port_name = 'chromium-gpu-mac'
+ else:
+ raise NotImplementedError('unsupported platform: %s' % platform)
+ if port_name.startswith('chromium-gpu-linux'):
+ return ChromiumGpuLinuxPort(host, port_name=port_name, **kwargs)
+ if port_name.startswith('chromium-gpu-cg-mac'):
+ return ChromiumGpuCgMacPort(host, port_name=port_name, **kwargs)
+ if port_name.startswith('chromium-gpu-mac'):
+ return ChromiumGpuMacPort(host, port_name=port_name, **kwargs)
+ if port_name.startswith('chromium-gpu-win'):
+ return ChromiumGpuWinPort(host, port_name=port_name, **kwargs)
+ raise NotImplementedError('unsupported port: %s' % port_name)
+
+
+# FIXME: These should really be a mixin class.
+
def _set_gpu_options(port, graphics_type='gpu'):
port._graphics_type = graphics_type
if port.get_option('accelerated_2d_canvas') is None:
@@ -64,7 +90,7 @@
paths += ['fast/canvas', 'canvas/philip']
if not paths:
- # FIXME: This is a hack until we can turn off the webkit_gpu
+ # FIXME: This is a hack until we can turn of the webkit_gpu
# tests on the bots. If paths is empty, port.tests()
# finds *everything*. However, we have to return something,
# or NRWT thinks there's something wrong. So, we return a single
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py (104165 => 104166)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py 2012-01-05 16:00:06 UTC (rev 104165)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py 2012-01-05 16:39:40 UTC (rev 104166)
@@ -27,12 +27,12 @@
import sys
import unittest
+import chromium_gpu
+
+from webkitpy.tool.mocktool import MockOptions
from webkitpy.common.host_mock import MockHost
+from webkitpy.layout_tests.port import port_testcase
from webkitpy.common.system.filesystem_mock import MockFileSystem
-from webkitpy.layout_tests.port import chromium_gpu
-from webkitpy.layout_tests.port import port_testcase
-from webkitpy.layout_tests.port.factory import PortFactory
-from webkitpy.tool.mocktool import MockOptions
class ChromiumGpuTest(unittest.TestCase):
@@ -62,9 +62,9 @@
builder_name='foo',
child_processes=None)
if input_name and platform:
- port = PortFactory(host).get(host, platform=platform, port_name=input_name, options=mock_options)
+ port = chromium_gpu.get(host, platform=platform, port_name=input_name, options=mock_options)
else:
- port = PortFactory(host).get(host, port_name=port_name, options=mock_options)
+ port = chromium_gpu.get(host, port_name=port_name, options=mock_options)
self.assertTrue(port._options.accelerated_2d_canvas)
self.assertTrue(port._options.accelerated_video)
self.assertTrue(port._options.experimental_fully_parallel)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py (104165 => 104166)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py 2012-01-05 16:00:06 UTC (rev 104165)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py 2012-01-05 16:39:40 UTC (rev 104166)
@@ -45,38 +45,31 @@
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 in ('cygwin', 'win32'):
- return 'chromium-gpu-win'
- if platform.startswith('linux'):
- return 'chromium-gpu-linux'
- if platform == 'darwin':
- return 'chromium-gpu-mac'
+ def _port_name_from_arguments_and_options(self, **kwargs):
+ port_to_use = kwargs.get('port_name', None)
+ options = kwargs.get('options', None)
+ if port_to_use is None:
+ if sys.platform == 'win32' or sys.platform == 'cygwin':
+ if options and hasattr(options, 'chromium') and options.chromium:
+ port_to_use = 'chromium-win'
+ else:
+ port_to_use = 'win'
+ elif sys.platform.startswith('linux'):
+ port_to_use = 'chromium-linux'
+ elif sys.platform == 'darwin':
+ if options and hasattr(options, 'chromium') and options.chromium:
+ port_to_use = 'chromium-cg-mac'
+ # FIXME: Add a way to select the chromium-mac port.
+ else:
+ port_to_use = 'mac'
- if port_name:
- return port_name
+ if port_to_use is None:
+ raise NotImplementedError('unknown port; sys.platform = "%s"' % sys.platform)
+ return port_to_use
- if platform in ('win32', 'cygwin'):
- if options and hasattr(options, 'chromium') and options.chromium:
- return 'chromium-win'
- return 'win'
- if platform.startswith('linux'):
- return 'chromium-linux'
- if platform == 'darwin':
- if options and hasattr(options, 'chromium') and options.chromium:
- return 'chromium-cg-mac'
- # FIXME: Add a way to select the chromium-mac port.
- return 'mac'
+ def _get_kwargs(self, **kwargs):
+ port_to_use = self._port_name_from_arguments_and_options(**kwargs)
- raise NotImplementedError('unknown port; platform = "%s"' % platform)
-
- def get(self, port_name=None, options=None, platform=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."""
- platform = platform or sys.platform
- port_to_use = self._port_name_from_arguments_and_options(port_name, options, platform)
if port_to_use.startswith('test'):
import test
maker = test.TestPort
@@ -98,18 +91,9 @@
elif port_to_use.startswith('qt'):
import qt
maker = qt.QtPort
- elif port_to_use.startswith('chromium-gpu-linux'):
+ elif port_to_use.startswith('chromium-gpu'):
import chromium_gpu
- maker = chromium_gpu.ChromiumGpuLinuxPort
- elif port_to_use.startswith('chromium-gpu-cg-mac'):
- import chromium_gpu
- maker = chromium_gpu.ChromiumGpuCgMacPort
- elif port_to_use.startswith('chromium-gpu-mac'):
- import chromium_gpu
- maker = chromium_gpu.ChromiumGpuMacPort
- elif port_to_use.startswith('chromium-gpu-win'):
- import chromium_gpu
- maker = chromium_gpu.ChromiumGpuWinPort
+ maker = chromium_gpu.get
elif port_to_use.startswith('chromium-mac') or port_to_use.startswith('chromium-cg-mac'):
import chromium_mac
maker = chromium_mac.ChromiumMacPort
@@ -119,27 +103,16 @@
elif port_to_use.startswith('chromium-win'):
import chromium_win
maker = chromium_win.ChromiumWinPort
- elif port_to_use == 'google-chrome-linux32':
+ elif port_to_use.startswith('google-chrome'):
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
+ maker = google_chrome.GetGoogleChromePort
elif port_to_use.startswith('efl'):
import efl
maker = efl.EflPort
else:
raise NotImplementedError('unsupported port: %s' % port_to_use)
- return maker(self._host, port_name=port_name, options=options, **kwargs)
+ return maker(self._host, **kwargs)
def all_port_names(self):
"""Return a list of all valid, fully-specified, "real" port names.
@@ -150,6 +123,17 @@
# FIXME: There's probably a better way to generate this list ...
return builders.all_port_names()
+ 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."""
+ # Wrapped for backwards-compatibility
+ if port_name:
+ kwargs['port_name'] = port_name
+ if options:
+ kwargs['options'] = options
+ return self._get_kwargs(**kwargs)
+
def get_from_builder_name(self, builder_name):
port_name = builders.port_name_for_builder_name(builder_name)
assert(port_name) # Need to update port_name_for_builder_name
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py (104165 => 104166)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py 2012-01-05 16:00:06 UTC (rev 104165)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py 2012-01-05 16:39:40 UTC (rev 104166)
@@ -104,10 +104,12 @@
self.assert_platform_port("cygwin", self.webkit_options, win.WinPort)
def test_google_chrome(self):
- self.assert_port("google-chrome-linux32", google_chrome.GoogleChromeLinux32Port)
- self.assert_port("google-chrome-linux64", google_chrome.GoogleChromeLinux64Port)
- self.assert_port("google-chrome-win", google_chrome.GoogleChromeWinPort)
- self.assert_port("google-chrome-mac", google_chrome.GoogleChromeMacPort)
+ # The actual Chrome class names aren't available so we test that the
+ # objects we get are at least subclasses of the Chromium versions.
+ self.assert_port("google-chrome-linux32", chromium_linux.ChromiumLinuxPort)
+ self.assert_port("google-chrome-linux64", chromium_linux.ChromiumLinuxPort)
+ self.assert_port("google-chrome-win", chromium_win.ChromiumWinPort)
+ self.assert_port("google-chrome-mac", chromium_mac.ChromiumMacPort)
def test_gtk(self):
self.assert_port("gtk", gtk.GtkPort)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py (104165 => 104166)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py 2012-01-05 16:00:06 UTC (rev 104165)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome.py 2012-01-05 16:39:40 UTC (rev 104166)
@@ -24,11 +24,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-import chromium_linux
-import chromium_mac
-import chromium_win
-
def _test_expectations_overrides(port, super):
# The chrome ports use the regular overrides plus anything in the
# official test_expectations as well. Hopefully we don't get collisions.
@@ -46,47 +42,70 @@
return chromium_overrides + port._filesystem.read_text_file(overrides_path)
-class GoogleChromeLinux32Port(chromium_linux.ChromiumLinuxPort):
- def baseline_search_path(self):
- paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self)
- paths.insert(0, self._webkit_baseline_path('google-chrome-linux32'))
- return paths
+def GetGoogleChromePort(host, **kwargs):
+ """Some tests have slightly different results when compiled as Google
+ Chrome vs Chromium. In those cases, we prepend an additional directory to
+ to the baseline paths."""
+ # FIXME: This whole routine is a tremendous hack that needs to be cleaned up.
- def test_expectations_overrides(self):
- return _test_expectations_overrides(self, chromium_linux.ChromiumLinuxPort)
+ port_name = kwargs['port_name']
+ del kwargs['port_name']
+ if port_name == 'google-chrome-linux32':
+ import chromium_linux
- def architecture(self):
- return 'x86'
+ class GoogleChromeLinux32Port(chromium_linux.ChromiumLinuxPort):
+ def baseline_search_path(self):
+ paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self)
+ paths.insert(0, self._webkit_baseline_path('google-chrome-linux32'))
+ return paths
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self, chromium_linux.ChromiumLinuxPort)
-class GoogleChromeLinux64Port(chromium_linux.ChromiumLinuxPort):
- def baseline_search_path(self):
- paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self)
- paths.insert(0, self._webkit_baseline_path('google-chrome-linux64'))
- return paths
+ def architecture(self):
+ return 'x86'
- def test_expectations_overrides(self):
- return _test_expectations_overrides(self, chromium_linux.ChromiumLinuxPort)
+ return GoogleChromeLinux32Port(host, port_name='chromium-linux-x86', **kwargs)
+ elif port_name == 'google-chrome-linux64':
+ import chromium_linux
- def architecture(self):
- return 'x86_64'
+ class GoogleChromeLinux64Port(chromium_linux.ChromiumLinuxPort):
+ def baseline_search_path(self):
+ paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(self)
+ paths.insert(0, self._webkit_baseline_path('google-chrome-linux64'))
+ return paths
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self, chromium_linux.ChromiumLinuxPort)
-class GoogleChromeMacPort(chromium_mac.ChromiumMacPort):
- def baseline_search_path(self):
- paths = chromium_mac.ChromiumMacPort.baseline_search_path(self)
- paths.insert(0, self._webkit_baseline_path('google-chrome-mac'))
- return paths
+ def architecture(self):
+ return 'x86_64'
- def test_expectations_overrides(self):
- return _test_expectations_overrides(self, chromium_mac.ChromiumMacPort)
+ return GoogleChromeLinux64Port(host, port_name='chromium-linux-x86_64', **kwargs)
+ elif port_name.startswith('google-chrome-mac'):
+ import chromium_mac
+ class GoogleChromeMacPort(chromium_mac.ChromiumMacPort):
+ def baseline_search_path(self):
+ paths = chromium_mac.ChromiumMacPort.baseline_search_path(self)
+ paths.insert(0, self._webkit_baseline_path('google-chrome-mac'))
+ return paths
-class GoogleChromeWinPort(chromium_win.ChromiumWinPort):
- def baseline_search_path(self):
- paths = chromium_win.ChromiumWinPort.baseline_search_path(self)
- paths.insert(0, self._webkit_baseline_path('google-chrome-win'))
- return paths
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self, chromium_mac.ChromiumMacPort)
- def test_expectations_overrides(self):
- return _test_expectations_overrides(self, chromium_win.ChromiumWinPort)
+ return GoogleChromeMacPort(host, **kwargs)
+ elif port_name.startswith('google-chrome-win'):
+ import chromium_win
+
+ class GoogleChromeWinPort(chromium_win.ChromiumWinPort):
+ def baseline_search_path(self):
+ paths = chromium_win.ChromiumWinPort.baseline_search_path(self)
+ paths.insert(0, self._webkit_baseline_path('google-chrome-win'))
+ return paths
+
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self, chromium_win.ChromiumWinPort)
+
+ return GoogleChromeWinPort(host, **kwargs)
+ raise NotImplementedError('unsupported port: %s' % port_name)
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py (104165 => 104166)
--- trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py 2012-01-05 16:00:06 UTC (rev 104165)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py 2012-01-05 16:39:40 UTC (rev 104166)
@@ -27,6 +27,7 @@
import unittest
from webkitpy.common.host_mock import MockHost
+from webkitpy.layout_tests.port import google_chrome
class GetGoogleChromePortTest(unittest.TestCase):
@@ -41,7 +42,7 @@
self._verify_baseline_path('google-chrome-win', 'google-chrome-win-vista')
def _verify_baseline_path(self, expected_path, port_name):
- port = MockHost().port_factory.get(port_name=port_name)
+ port = google_chrome.GetGoogleChromePort(MockHost(), port_name=port_name)
path = port.baseline_search_path()[0]
self.assertEqual(expected_path, port._filesystem.basename(path))
@@ -54,7 +55,7 @@
host = MockHost()
chromium_port = host.port_factory.get("chromium-cg-mac")
chromium_base = chromium_port.path_from_chromium_base()
- port = host.port_factory.get(port_name=port_name, options=None)
+ port = google_chrome.GetGoogleChromePort(host, port_name=port_name, options=None)
expected_chromium_overrides = '// chromium overrides\n'
expected_chrome_overrides = '// chrome overrides\n'