From d9061f86552b505aa4c9b4c5fdd54a2acd594939 Mon Sep 17 00:00:00 2001 From: "dpranke@chromium.org" Date: Tue, 24 Jan 2012 02:09:36 +0000 Subject: [PATCH] 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 --- Tools/ChangeLog | 25 ++++++++++++++++++++++ .../Scripts/webkitpy/layout_tests/port/factory.py | 10 ++++++--- .../webkitpy/layout_tests/port/factory_unittest.py | 7 +++--- .../webkitpy/layout_tests/run_webkit_tests.py | 7 +++--- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 8b42876..748f869 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,5 +1,30 @@ 2012-01-23 Dirk Pranke + 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 + run-webkit-tests needs to propagate --chromium https://bugs.webkit.org/show_bug.cgi?id=76870 diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/Tools/Scripts/webkitpy/layout_tests/port/factory.py index f0127b0..1ad3c02 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/factory.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/factory.py @@ -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 diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py index 60f333e..c199626 100644 --- a/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py +++ b/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py @@ -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): diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py index 484298c..72a73c5 100755 --- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py +++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py @@ -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", -- 2.7.4