[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

dpranke at chromium.org dpranke at chromium.org
Thu Apr 8 01:58:35 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit e4a6accc5f4718113195f83cc146af3c05fbd56c
Author: dpranke at chromium.org <dpranke at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 25 01:07:59 2010 +0000

    2010-02-23  Dirk Pranke  <dpranke at chromium.org>
    
            Reviewed by David Levin.
    
            When the run-chromium-webkit-tests code was landed and the code was
            refactored into the 'port' package, I accidentally broke using
            http_server.py or websocket_server.py as command-line scripts
            (the constructors needed a port object they weren't getting). This
            change fixes them so that --server start|stop actually works.
    
            As a part of this, the two files need to be able to call port.get(),
            but doing that is awkward from a file inside the package, so I moved
            get() into factory.py and imported that into __init__.py so that
            http_server.py and websocket_server.py can just import factory.
    
            https://bugs.webkit.org/show_bug.cgi?id=35316
    
            * Scripts/webkitpy/layout_tests/port/__init__.py:
            * Scripts/webkitpy/layout_tests/port/factory.py:
            * Scripts/webkitpy/layout_tests/port/http_server.py:
            * Scripts/webkitpy/layout_tests/port/websocket_server.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 611583d..4558474 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,25 @@
+2010-02-23  Dirk Pranke  <dpranke at chromium.org>
+
+        Reviewed by David Levin.
+
+        When the run-chromium-webkit-tests code was landed and the code was
+        refactored into the 'port' package, I accidentally broke using
+        http_server.py or websocket_server.py as command-line scripts
+        (the constructors needed a port object they weren't getting). This
+        change fixes them so that --server start|stop actually works.
+
+        As a part of this, the two files need to be able to call port.get(),
+        but doing that is awkward from a file inside the package, so I moved
+        get() into factory.py and imported that into __init__.py so that
+        http_server.py and websocket_server.py can just import factory.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35316
+
+        * Scripts/webkitpy/layout_tests/port/__init__.py:
+        * Scripts/webkitpy/layout_tests/port/factory.py:
+        * Scripts/webkitpy/layout_tests/port/http_server.py:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
 2010-02-24  Dirk Pranke  <dpranke at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
index 3509675..e3ad6f4 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
@@ -29,37 +29,4 @@
 
 """Port-specific entrypoints for the layout tests test infrastructure."""
 
-
-import sys
-
-
-def get(port_name=None, options=None):
-    """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 = port_name
-    if port_to_use is None:
-        if sys.platform == 'win32':
-            port_to_use = 'chromium-win'
-        elif sys.platform == 'linux2':
-            port_to_use = 'chromium-linux'
-        elif sys.platform == 'darwin':
-            port_to_use = 'chromium-mac'
-
-    if port_to_use == 'test':
-        import test
-        return test.TestPort(port_name, options)
-    elif port_to_use.startswith('mac'):
-        import mac
-        return mac.MacPort(port_name, options)
-    elif port_to_use.startswith('chromium-mac'):
-        import chromium_mac
-        return chromium_mac.ChromiumMacPort(port_name, options)
-    elif port_to_use.startswith('chromium-linux'):
-        import chromium_linux
-        return chromium_linux.ChromiumLinuxPort(port_name, options)
-    elif port_to_use.startswith('chromium-win'):
-        import chromium_win
-        return chromium_win.ChromiumWinPort(port_name, options)
-
-    raise NotImplementedError('unsupported port: %s' % port_to_use)
+from factory import get
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index 1001dcd..ece10b0 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -134,10 +134,10 @@ class ChromiumMacPort(chromium.ChromiumPort):
                             'apache2-httpd.conf')
 
     def _path_to_lighttpd(self):
-        return self._lighttp_path('bin', 'lighttp')
+        return self._lighttpd_path('bin', 'lighttpd')
 
     def _path_to_lighttpd_modules(self):
-        return self._lighttp_path('lib')
+        return self._lighttpd_path('lib')
 
     def _path_to_lighttpd_php(self):
         return self._lighttpd_path('bin', 'php-cgi')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
new file mode 100644
index 0000000..20da2b9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Factory method to retrieve the appropriate port implementation."""
+
+
+import sys
+
+
+def get(port_name=None, options=None):
+    """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 = port_name
+    if port_to_use is None:
+        if sys.platform == 'win32':
+            port_to_use = 'chromium-win'
+        elif sys.platform == 'linux2':
+            port_to_use = 'chromium-linux'
+        elif sys.platform == 'darwin':
+            port_to_use = 'chromium-mac'
+
+    if port_to_use == 'test':
+        import test
+        return test.TestPort(port_name, options)
+    elif port_to_use.startswith('mac'):
+        import mac
+        return mac.MacPort(port_name, options)
+    elif port_to_use.startswith('chromium-mac'):
+        import chromium_mac
+        return chromium_mac.ChromiumMacPort(port_name, options)
+    elif port_to_use.startswith('chromium-linux'):
+        import chromium_linux
+        return chromium_linux.ChromiumLinuxPort(port_name, options)
+    elif port_to_use.startswith('chromium-win'):
+        import chromium_win
+        return chromium_win.ChromiumWinPort(port_name, options)
+
+    raise NotImplementedError('unsupported port: %s' % port_to_use)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
index 0315704..e56040c 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
@@ -40,6 +40,7 @@ import tempfile
 import time
 import urllib
 
+import factory
 import http_server_base
 
 
@@ -261,7 +262,9 @@ if '__main__' == __name__:
             # source of tests. Specifying port but no root does not seem
             # meaningful.
             raise 'Specifying port requires also a root.'
-        httpd = Lighttpd(tempfile.gettempdir(),
+        port_obj = factory.get()
+        httpd = Lighttpd(port_obj,
+                         tempfile.gettempdir(),
                          port=options.port,
                          root=options.root,
                          register_cygwin=options.register_cygwin,
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
index 54c2f6f..cb8e024 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
@@ -39,6 +39,7 @@ import tempfile
 import time
 import urllib
 
+import factory
 import http_server
 
 _WS_LOG_PREFIX = 'pywebsocket.ws.log-'
@@ -296,7 +297,8 @@ if '__main__' == __name__:
     if options.pidfile:
         kwds['pidfile'] = options.pidfile
 
-    pywebsocket = PyWebSocket(tempfile.gettempdir(), **kwds)
+    port_obj = factory.get()
+    pywebsocket = PyWebSocket(port_obj, tempfile.gettempdir(), **kwds)
 
     if 'start' == options.server:
         pywebsocket.start()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list