Commit d9061f86 authored by dpranke@chromium.org's avatar dpranke@chromium.org

nrwt: make --chromium work like --qt

https://bugs.webkit.org/show_bug.cgi?id=76875

Reviewed by Adam Barth.

--chromium used to have to be handled differently from --qt
due to the way the PortFactory was implemented; there's not
really a good reason for that any more so this patch makes
things slightly more consistent and eliminates the
options.chromium flag (--chromium is now truly a synonym for
--platform chromium).

* Scripts/webkitpy/layout_tests/port/factory.py:
(PortFactory._default_port):
(PortFactory.get):
* Scripts/webkitpy/layout_tests/port/factory_unittest.py:
(FactoryTest.setUp):
(FactoryTest.test_chromium_mac):
(FactoryTest.test_chromium_linux):
(FactoryTest.test_chromium_win):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 13bb4476
2012-01-23 Dirk Pranke <dpranke@chromium.org>
nrwt: make --chromium work like --qt
https://bugs.webkit.org/show_bug.cgi?id=76875
Reviewed by Adam Barth.
--chromium used to have to be handled differently from --qt
due to the way the PortFactory was implemented; there's not
really a good reason for that any more so this patch makes
things slightly more consistent and eliminates the
options.chromium flag (--chromium is now truly a synonym for
--platform chromium).
* Scripts/webkitpy/layout_tests/port/factory.py:
(PortFactory._default_port):
(PortFactory.get):
* Scripts/webkitpy/layout_tests/port/factory_unittest.py:
(FactoryTest.setUp):
(FactoryTest.test_chromium_mac):
(FactoryTest.test_chromium_linux):
(FactoryTest.test_chromium_win):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
2012-01-23 Dirk Pranke <dpranke@chromium.org>
run-webkit-tests needs to propagate --chromium
......@@ -67,9 +67,7 @@ class PortFactory(object):
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():
if platform.is_linux():
return 'chromium-linux'
elif platform.is_mac():
return 'mac'
......@@ -83,6 +81,12 @@ class PortFactory(object):
appropriate port on this platform."""
port_name = port_name or self._default_port(options)
# FIXME(dpranke): We special-case '--platform chromium' so that it can co-exist
# with '--platform chromium-mac' and '--platform chromium-linux' properly (we
# can't look at the port_name prefix in this case).
if port_name == 'chromium':
port_name = 'chromium-' + self._host.platform.os_name
# FIXME: Remove this when we remove the chromium-gpu ports.
if port_name == 'chromium-gpu':
port_name = port_name + '-' + self._host.platform.os_name
......
......@@ -52,7 +52,6 @@ class FactoryTest(unittest.TestCase):
def setUp(self):
self.webkit_options = MockOptions(pixel_tests=False)
self.chromium_options = MockOptions(pixel_tests=False, chromium=True)
def assert_port(self, port_name=None, os_name=None, os_version=None, options=None, cls=None):
host = MockSystemHost(os_name=os_name, os_version=os_version)
......@@ -115,19 +114,19 @@ class FactoryTest(unittest.TestCase):
self.assert_port(port_name='chromium-mac-leopard', cls=chromium_mac.ChromiumMacPort)
self.assert_port(port_name='chromium-mac', os_name='mac', os_version='leopard',
cls=chromium_mac.ChromiumMacPort)
self.assert_port(port_name=None, os_name='mac', os_version='leopard', options=self.chromium_options,
self.assert_port(port_name='chromium', os_name='mac', os_version='leopard',
cls=chromium_mac.ChromiumMacPort)
def test_chromium_linux(self):
self.assert_port(port_name='chromium-linux', cls=chromium_linux.ChromiumLinuxPort)
self.assert_port(port_name=None, os_name='linux', os_version='lucid', options=self.chromium_options,
self.assert_port(port_name='chromium', os_name='linux', os_version='lucid',
cls=chromium_linux.ChromiumLinuxPort)
def test_chromium_win(self):
self.assert_port(port_name='chromium-win-xp', cls=chromium_win.ChromiumWinPort)
self.assert_port(port_name='chromium-win', os_name='win', os_version='xp',
cls=chromium_win.ChromiumWinPort)
self.assert_port(port_name=None, os_name='win', os_version='xp', options=self.chromium_options,
self.assert_port(port_name='chromium', os_name='win', os_version='xp',
cls=chromium_win.ChromiumWinPort)
def test_unknown_specified(self):
......
......@@ -170,17 +170,16 @@ def parse_args(args=None):
help='Set the configuration to Release'),
# old-run-webkit-tests also accepts -c, --configuration CONFIGURATION.
optparse.make_option("--platform", help="Override port/platform being tested (i.e. chromium-mac)"),
optparse.make_option('--qt', action='store_const', const='qt', dest="platform", help='Alias for --platform=qt'),
optparse.make_option('--gtk', action='store_const', const='gtk', dest="platform", help='Alias for --platform=gtk'),
optparse.make_option("--chromium", action="store_const", const='chromium', dest='platform', help='Alias for --platform=chromium'),
optparse.make_option('--efl', action='store_const', const='efl', dest="platform", help='Alias for --platform=efl'),
optparse.make_option('--gtk', action='store_const', const='gtk', dest="platform", help='Alias for --platform=gtk'),
optparse.make_option('--qt', action='store_const', const='qt', dest="platform", help='Alias for --platform=qt'),
]
print_options = printing.print_options()
# FIXME: These options should move onto the ChromiumPort.
chromium_options = [
optparse.make_option("--chromium", action="store_true", default=False,
help="use the Chromium port"),
optparse.make_option("--startup-dialog", action="store_true",
default=False, help="create a dialog on DumpRenderTree startup"),
optparse.make_option("--gp-fault-error-box", action="store_true",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment