Title: [105674] trunk/Tools
Revision
105674
Author
[email protected]
Date
2012-01-23 18:09:36 -0800 (Mon, 23 Jan 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (105673 => 105674)


--- trunk/Tools/ChangeLog	2012-01-24 02:05:17 UTC (rev 105673)
+++ trunk/Tools/ChangeLog	2012-01-24 02:09:36 UTC (rev 105674)
@@ -1,5 +1,30 @@
 2012-01-23  Dirk Pranke  <[email protected]>
 
+        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  <[email protected]>
+
         run-webkit-tests needs to propagate --chromium
         https://bugs.webkit.org/show_bug.cgi?id=76870
 

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py (105673 => 105674)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py	2012-01-24 02:05:17 UTC (rev 105673)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/factory.py	2012-01-24 02:09:36 UTC (rev 105674)
@@ -67,9 +67,7 @@
 
     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 @@
         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

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py (105673 => 105674)


--- trunk/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py	2012-01-24 02:05:17 UTC (rev 105673)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/port/factory_unittest.py	2012-01-24 02:09:36 UTC (rev 105674)
@@ -52,7 +52,6 @@
 
     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 @@
         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):

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (105673 => 105674)


--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2012-01-24 02:05:17 UTC (rev 105673)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py	2012-01-24 02:09:36 UTC (rev 105674)
@@ -170,17 +170,16 @@
                              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='', const='qt', dest="platform", help='Alias for --platform=qt'),
-        optparse.make_option('--gtk', action='', const='gtk', dest="platform", help='Alias for --platform=gtk'),
+        optparse.make_option("--chromium", action="" const='chromium', dest='platform', help='Alias for --platform=chromium'),
         optparse.make_option('--efl', action='', const='efl', dest="platform", help='Alias for --platform=efl'),
+        optparse.make_option('--gtk', action='', const='gtk', dest="platform", help='Alias for --platform=gtk'),
+        optparse.make_option('--qt', action='', 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="" default=False,
-            help="use the Chromium port"),
         optparse.make_option("--startup-dialog", action=""
             default=False, help="create a dialog on DumpRenderTree startup"),
         optparse.make_option("--gp-fault-error-box", action=""
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to