<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[210523] trunk/Tools</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/210523">210523</a></dd>
<dt>Author</dt> <dd>clopez@igalia.com</dd>
<dt>Date</dt> <dd>2017-01-09 14:28:43 -0800 (Mon, 09 Jan 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>[GTK][Wayland] Allow running the layout tests under a native Wayland environment.
https://bugs.webkit.org/show_bug.cgi?id=165232
Reviewed by Michael Catanzaro.
Add a new WaylandDriver to run the tests in the user current wayland session.
Also merge all the configuration options for selecting the display server inside one
switch --display-server=xvfb/xorg/wayland/weston (defaulting to xvfb).
This switch is supported on the scripts: run-gtk-tests, run-perf-tests and run-webkit-tests.
* Scripts/run-gtk-tests: Add missing logging.basicConfig() initialization for the error logger.
(TestRunner._create_driver):
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
(PerfTestsRunner._parse_args):
* Scripts/webkitpy/port/gtk.py:
(GtkPort.__init__):
(GtkPort._driver_class):
(GtkPort._search_paths):
* Scripts/webkitpy/port/waylanddriver.py: Added.
(WaylandDriver):
(WaylandDriver.check_driver):
(WaylandDriver._setup_environ_for_test):
(WaylandDriver._start):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptsrungtktests">trunk/Tools/Scripts/run-gtk-tests</a></li>
<li><a href="#trunkToolsScriptswebkitpylayout_testsrun_webkit_testspy">trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyperformance_testsperftestsrunnerpy">trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportgtkpy">trunk/Tools/Scripts/webkitpy/port/gtk.py</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkToolsScriptswebkitpyportwaylanddriverpy">trunk/Tools/Scripts/webkitpy/port/waylanddriver.py</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (210522 => 210523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2017-01-09 22:02:47 UTC (rev 210522)
+++ trunk/Tools/ChangeLog        2017-01-09 22:28:43 UTC (rev 210523)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2017-01-09 Carlos Alberto Lopez Perez <clopez@igalia.com>
+
+ [GTK][Wayland] Allow running the layout tests under a native Wayland environment.
+ https://bugs.webkit.org/show_bug.cgi?id=165232
+
+ Reviewed by Michael Catanzaro.
+
+ Add a new WaylandDriver to run the tests in the user current wayland session.
+
+ Also merge all the configuration options for selecting the display server inside one
+ switch --display-server=xvfb/xorg/wayland/weston (defaulting to xvfb).
+
+ This switch is supported on the scripts: run-gtk-tests, run-perf-tests and run-webkit-tests.
+
+ * Scripts/run-gtk-tests: Add missing logging.basicConfig() initialization for the error logger.
+ (TestRunner._create_driver):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ (parse_args):
+ * Scripts/webkitpy/performance_tests/perftestsrunner.py:
+ (PerfTestsRunner._parse_args):
+ * Scripts/webkitpy/port/gtk.py:
+ (GtkPort.__init__):
+ (GtkPort._driver_class):
+ (GtkPort._search_paths):
+ * Scripts/webkitpy/port/waylanddriver.py: Added.
+ (WaylandDriver):
+ (WaylandDriver.check_driver):
+ (WaylandDriver._setup_environ_for_test):
+ (WaylandDriver._start):
+
</ins><span class="cx"> 2017-01-09 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> [QuickLook] Add a layout test for webkit.org/b/135651
</span></span></pre></div>
<a id="trunkToolsScriptsrungtktests"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/run-gtk-tests (210522 => 210523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/run-gtk-tests        2017-01-09 22:02:47 UTC (rev 210522)
+++ trunk/Tools/Scripts/run-gtk-tests        2017-01-09 22:28:43 UTC (rev 210523)
</span><span class="lines">@@ -17,6 +17,7 @@
</span><span class="cx"> # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
</span><span class="cx"> # Boston, MA 02110-1301, USA.
</span><span class="cx">
</span><ins>+import logging
</ins><span class="cx"> import subprocess
</span><span class="cx"> import os
</span><span class="cx"> import sys
</span><span class="lines">@@ -209,10 +210,7 @@
</span><span class="cx"> return True
</span><span class="cx">
</span><span class="cx"> def _create_driver(self, port_options=[]):
</span><del>- if self._options.use_wayland:
- self._port._wayland = True
- else:
- self._port._nativexorg = not self._options.use_xvfb
</del><ins>+ self._port._display_server = self._options.display_server
</ins><span class="cx"> driver = self._port.create_driver(worker_number=0, no_timeout=True)._make_driver(pixel_tests=False)
</span><span class="cx"> if not driver.check_driver(self._port):
</span><span class="cx"> raise RuntimeError("Failed to check driver %s" %driver.__class__.__name__)
</span><span class="lines">@@ -486,11 +484,12 @@
</span><span class="cx"> option_parser.add_option('-t', '--timeout',
</span><span class="cx"> action='store', type='int', dest='timeout', default=10,
</span><span class="cx"> help='Time in seconds until a test times out')
</span><del>- option_parser.add_option('--no-xvfb', action='store_false', dest='use_xvfb', default=True,
- help='Do not run tests under Xvfb')
- option_parser.add_option('--wayland', action='store_true', dest='use_wayland', default=False,
- help='Run the layout tests inside a (virtualized) weston')
</del><ins>+ option_parser.add_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb',
+ help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
+ '"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'),
</ins><span class="cx"> options, args = option_parser.parse_args()
</span><span class="cx">
</span><ins>+ logging.basicConfig(level=logging.INFO, format="%(message)s")
+
</ins><span class="cx"> runner = TestRunner(options, args)
</span><span class="cx"> sys.exit(runner.run_tests())
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpylayout_testsrun_webkit_testspy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (210522 => 210523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py        2017-01-09 22:02:47 UTC (rev 210522)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py        2017-01-09 22:28:43 UTC (rev 210523)
</span><span class="lines">@@ -289,8 +289,9 @@
</span><span class="cx"> optparse.make_option("--profiler", action="store",
</span><span class="cx"> help="Output per-test profile information, using the specified profiler."),
</span><span class="cx"> optparse.make_option("--no-timeout", action="store_true", default=False, help="Disable test timeouts"),
</span><del>- optparse.make_option("--wayland", action="store_true", default=False,
- help="Run the layout tests inside a (virtualized) weston compositor (GTK only)."),
</del><ins>+ optparse.make_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb',
+ help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
+ '"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'),
</ins><span class="cx"> ]))
</span><span class="cx">
</span><span class="cx"> option_group_definitions.append(("iOS Simulator Options", [
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyperformance_testsperftestsrunnerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py (210522 => 210523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py        2017-01-09 22:02:47 UTC (rev 210522)
+++ trunk/Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py        2017-01-09 22:28:43 UTC (rev 210523)
</span><span class="lines">@@ -135,6 +135,9 @@
</span><span class="cx"> help="wrapper command to insert before invocations of "
</span><span class="cx"> "DumpRenderTree or WebKitTestRunner; option is split on whitespace before "
</span><span class="cx"> "running. (Example: --wrapper='valgrind --smc-check=all')"),
</span><ins>+ optparse.make_option('--display-server', choices=['xvfb', 'xorg', 'weston', 'wayland'], default='xvfb',
+ help='"xvfb": Use a virtualized X11 server. "xorg": Use the current X11 session. '
+ '"weston": Use a virtualized Weston server. "wayland": Use the current wayland session.'),
</ins><span class="cx"> ]
</span><span class="cx"> return optparse.OptionParser(option_list=(perf_option_list)).parse_args(args)
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportgtkpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/gtk.py (210522 => 210523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/gtk.py        2017-01-09 22:02:47 UTC (rev 210522)
+++ trunk/Tools/Scripts/webkitpy/port/gtk.py        2017-01-09 22:28:43 UTC (rev 210523)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx"> # Copyright (C) 2010 Google Inc. All rights reserved.
</span><span class="cx"> # Copyright (C) 2013 Samsung Electronics. All rights reserved.
</span><ins>+# Copyright (C) 2017 Igalia S.L. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Redistribution and use in source and binary forms, with or without
</span><span class="cx"> # modification, are permitted provided that the following conditions are
</span><span class="lines">@@ -40,6 +41,7 @@
</span><span class="cx"> from webkitpy.port.xvfbdriver import XvfbDriver
</span><span class="cx"> from webkitpy.port.westondriver import WestonDriver
</span><span class="cx"> from webkitpy.port.xorgdriver import XorgDriver
</span><ins>+from webkitpy.port.waylanddriver import WaylandDriver
</ins><span class="cx"> from webkitpy.port.linux_get_crash_log import GDBCrashLogGenerator
</span><span class="cx"> from webkitpy.port.leakdetector_valgrind import LeakDetectorValgrind
</span><span class="cx">
</span><span class="lines">@@ -52,10 +54,7 @@
</span><span class="cx"> def __init__(self, *args, **kwargs):
</span><span class="cx"> super(GtkPort, self).__init__(*args, **kwargs)
</span><span class="cx"> self._pulseaudio_sanitizer = PulseAudioSanitizer()
</span><del>- self._wayland = self.get_option("wayland")
- self._nativexorg = False
- if os.environ.get("USE_NATIVE_XDISPLAY"):
- self._nativexorg = True
</del><ins>+ self._display_server = self.get_option("display_server")
</ins><span class="cx">
</span><span class="cx"> if self.get_option("leaks"):
</span><span class="cx"> self._leakdetector = LeakDetectorValgrind(self._executive, self._filesystem, self.results_directory())
</span><span class="lines">@@ -80,9 +79,12 @@
</span><span class="cx">
</span><span class="cx"> @memoized
</span><span class="cx"> def _driver_class(self):
</span><del>- if self._wayland:
</del><ins>+ if self._display_server == "weston":
</ins><span class="cx"> return WestonDriver
</span><del>- if self._nativexorg:
</del><ins>+ if self._display_server == "wayland":
+ return WaylandDriver
+ # FIXME: re-configure the perf bot to pass --display-server=xorg
+ if self._display_server == "xorg" or os.environ.get("USE_NATIVE_XDISPLAY"):
</ins><span class="cx"> return XorgDriver
</span><span class="cx"> return XvfbDriver
</span><span class="cx">
</span><span class="lines">@@ -190,7 +192,7 @@
</span><span class="cx">
</span><span class="cx"> def _search_paths(self):
</span><span class="cx"> search_paths = []
</span><del>- if self._wayland:
</del><ins>+ if self._driver_class() in [WaylandDriver, WestonDriver]:
</ins><span class="cx"> search_paths.append(self.port_name + "-wayland")
</span><span class="cx"> search_paths.append(self.port_name)
</span><span class="cx"> search_paths.append('wk2')
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportwaylanddriverpy"></a>
<div class="addfile"><h4>Added: trunk/Tools/Scripts/webkitpy/port/waylanddriver.py (0 => 210523)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/waylanddriver.py         (rev 0)
+++ trunk/Tools/Scripts/webkitpy/port/waylanddriver.py        2017-01-09 22:28:43 UTC (rev 210523)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+# Copyright (C) 2016 Igalia S.L. 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 the copyright holder 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.
+
+import logging
+import os
+
+from webkitpy.port.driver import Driver
+
+_log = logging.getLogger(__name__)
+
+
+class WaylandDriver(Driver):
+ @staticmethod
+ def check_driver(port):
+ if "WAYLAND_DISPLAY" not in os.environ:
+ _log.error("WAYLAND_DISPLAY not found in the environment. Cannot run tests.")
+ return False
+ return True
+
+ def _setup_environ_for_test(self):
+ driver_environment = self._port.setup_environ_for_server(self._server_name)
+ driver_environment['WAYLAND_DISPLAY'] = os.environ.get('WAYLAND_DISPLAY')
+ driver_environment['GDK_BACKEND'] = 'wayland'
+ if driver_environment.get('DISPLAY'):
+ del driver_environment['DISPLAY']
+ driver_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
+ driver_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
+ driver_environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
+ return driver_environment
+
+ def _start(self, pixel_tests, per_test_args):
+ super(WaylandDriver, self).stop()
+ self._driver_tempdir = self._port.host.filesystem.mkdtemp(prefix='%s-' % self._server_name)
+ self._crashed_process_name = None
+ self._crashed_pid = None
+ self._server_process = self._port._server_process_constructor(self._port, self._server_name, self.cmd_line(pixel_tests, per_test_args), self._setup_environ_for_test())
+ self._server_process.start()
</ins></span></pre>
</div>
</div>
</body>
</html>