<!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>[247550] 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/247550">247550</a></dd>
<dt>Author</dt> <dd>clopez@igalia.com</dd>
<dt>Date</dt> <dd>2019-07-17 18:05:51 -0700 (Wed, 17 Jul 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK][WPE][webkitpy] Refactor drivers to use the base driver for setting up the environment and start the drivers.
https://bugs.webkit.org/show_bug.cgi?id=199855

Reviewed by Michael Catanzaro.

The webkitpy drivers for GTK and WPE use their own versions for setting
up the environment and starting/stopping the drivers.
This refactors those drivers to use the base class driver functions.
As a benefit we get some fixes like support for setting the profiler
environment variables, and a simpler code.

* Scripts/webkitpy/port/driver.py:
(Driver._setup_environ_for_driver): This already correctly setups LOCAL_RESOURCE_ROOT and DUMPRENDERTREE_TEMP.
Add the remaining environment variable XDG_CACHE_HOME that is needed for Linux.
* Scripts/webkitpy/port/headlessdriver.py:
(HeadlessDriver._setup_environ_for_test):
* Scripts/webkitpy/port/waylanddriver.py:
(WaylandDriver._setup_environ_for_test):
* Scripts/webkitpy/port/westondriver.py:
(WestonDriver._setup_environ_for_test):
(WestonDriver.stop):
* Scripts/webkitpy/port/westondriver_unittest.py: now mock _test_runner_process_constructor as base driver does.
(WestonDriverTest.make_driver):
* Scripts/webkitpy/port/xorgdriver.py:
(XorgDriver._setup_environ_for_test):
* Scripts/webkitpy/port/xvfbdriver.py: the xvfb binary is started with the port server env
(XvfbDriver._setup_environ_for_test):
* Scripts/webkitpy/port/xvfbdriver_unittest.py: rename the variable to make clearer that it uses the port server env.
(XvfbDriverTest.make_driver):
(XvfbDriverTest.test_start):
(XvfbDriverTest.test_start_arbitrary_worker_number):
* Scripts/webkitpy/w3c/wpt_runner.py:
(main): Start the driver before trying to get its environment to define all the environment variables.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.__init__): Ditto.
* glib/api_test_runner.py:
(TestRunner._setup_testing_environment): Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsScriptswebkitpyportdriverpy">trunk/Tools/Scripts/webkitpy/port/driver.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportheadlessdriverpy">trunk/Tools/Scripts/webkitpy/port/headlessdriver.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportwaylanddriverpy">trunk/Tools/Scripts/webkitpy/port/waylanddriver.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportwestondriverpy">trunk/Tools/Scripts/webkitpy/port/westondriver.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportwestondriver_unittestpy">trunk/Tools/Scripts/webkitpy/port/westondriver_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportxorgdriverpy">trunk/Tools/Scripts/webkitpy/port/xorgdriver.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportxvfbdriverpy">trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyportxvfbdriver_unittestpy">trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py</a></li>
<li><a href="#trunkToolsScriptswebkitpyw3cwpt_runnerpy">trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py</a></li>
<li><a href="#trunkToolsScriptswebkitpywebdriver_testswebdriver_test_runnerpy">trunk/Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py</a></li>
<li><a href="#trunkToolsglibapi_test_runnerpy">trunk/Tools/glib/api_test_runner.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/ChangeLog       2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2019-07-17  Carlos Alberto Lopez Perez  <clopez@igalia.com>
+
+        [GTK][WPE][webkitpy] Refactor drivers to use the base driver for setting up the environment and start the drivers.
+        https://bugs.webkit.org/show_bug.cgi?id=199855
+
+        Reviewed by Michael Catanzaro.
+
+        The webkitpy drivers for GTK and WPE use their own versions for setting
+        up the environment and starting/stopping the drivers.
+        This refactors those drivers to use the base class driver functions.
+        As a benefit we get some fixes like support for setting the profiler
+        environment variables, and a simpler code.
+
+        * Scripts/webkitpy/port/driver.py:
+        (Driver._setup_environ_for_driver): This already correctly setups LOCAL_RESOURCE_ROOT and DUMPRENDERTREE_TEMP.
+        Add the remaining environment variable XDG_CACHE_HOME that is needed for Linux.
+        * Scripts/webkitpy/port/headlessdriver.py:
+        (HeadlessDriver._setup_environ_for_test):
+        * Scripts/webkitpy/port/waylanddriver.py:
+        (WaylandDriver._setup_environ_for_test):
+        * Scripts/webkitpy/port/westondriver.py:
+        (WestonDriver._setup_environ_for_test):
+        (WestonDriver.stop):
+        * Scripts/webkitpy/port/westondriver_unittest.py: now mock _test_runner_process_constructor as base driver does.
+        (WestonDriverTest.make_driver):
+        * Scripts/webkitpy/port/xorgdriver.py:
+        (XorgDriver._setup_environ_for_test):
+        * Scripts/webkitpy/port/xvfbdriver.py: the xvfb binary is started with the port server env
+        (XvfbDriver._setup_environ_for_test):
+        * Scripts/webkitpy/port/xvfbdriver_unittest.py: rename the variable to make clearer that it uses the port server env.
+        (XvfbDriverTest.make_driver):
+        (XvfbDriverTest.test_start):
+        (XvfbDriverTest.test_start_arbitrary_worker_number):
+        * Scripts/webkitpy/w3c/wpt_runner.py:
+        (main): Start the driver before trying to get its environment to define all the environment variables.
+        * Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
+        (WebDriverTestRunner.__init__): Ditto.
+        * glib/api_test_runner.py:
+        (TestRunner._setup_testing_environment): Ditto.
+
</ins><span class="cx"> 2019-07-17  Antoine Quint  <graouts@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Disable Pointer Events prior to watchOS 6
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportdriverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/driver.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/driver.py      2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/driver.py 2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -432,6 +432,12 @@
</span><span class="cx">         environment['SQLITE_EXEMPT_PATH_FROM_VNODE_GUARDS'] = os.path.realpath(environment['DUMPRENDERTREE_TEMP'])
</span><span class="cx">         environment['__XPC_SQLITE_EXEMPT_PATH_FROM_VNODE_GUARDS'] = environment['SQLITE_EXEMPT_PATH_FROM_VNODE_GUARDS']
</span><span class="cx"> 
</span><ins>+        if sys.platform.startswith('linux'):
+            # Currently on WebKit2, there is no API for setting the application cache directory.
+            # Each worker should have it's own and it should be cleaned afterwards.
+            # Set it to inside the temporary folder by prepending XDG_CACHE_HOME with DRIVER_TEMPDIR.
+            environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
+
</ins><span class="cx">         if self._profiler:
</span><span class="cx">             environment = self._profiler.adjusted_environment(environment)
</span><span class="cx">         return environment
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportheadlessdriverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/headlessdriver.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/headlessdriver.py      2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/headlessdriver.py 2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -38,18 +38,6 @@
</span><span class="cx"> 
</span><span class="cx"> class HeadlessDriver(Driver):
</span><span class="cx">     def _setup_environ_for_test(self):
</span><del>-        driver_environment = self._port.setup_environ_for_server(self._server_name)
</del><ins>+        driver_environment = super(HeadlessDriver, self)._setup_environ_for_test()
</ins><span class="cx">         driver_environment['WPE_USE_HEADLESS_VIEW_BACKEND'] = "1"
</span><del>-        driver_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
-        if self._driver_tempdir is not None:
-            driver_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
-            driver_environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
</del><span class="cx">         return driver_environment
</span><del>-
-    def _start(self, pixel_tests, per_test_args):
-        super(HeadlessDriver, self).stop()
-        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
-        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()
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpyportwaylanddriverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/waylanddriver.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/waylanddriver.py       2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/waylanddriver.py  2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -45,21 +45,9 @@
</span><span class="cx">         return True
</span><span class="cx"> 
</span><span class="cx">     def _setup_environ_for_test(self):
</span><del>-        driver_environment = self._port.setup_environ_for_server(self._server_name)
</del><ins>+        driver_environment = super(WaylandDriver, self)._setup_environ_for_test()
</ins><span class="cx">         self._port._copy_value_from_environ_if_set(driver_environment, 'WAYLAND_DISPLAY')
</span><span class="cx">         self._port._copy_value_from_environ_if_set(driver_environment, 'WAYLAND_SOCKET')
</span><span class="cx">         driver_environment['GDK_BACKEND'] = 'wayland'
</span><span class="cx">         driver_environment['EGL_PLATFORM'] = 'wayland'
</span><del>-        driver_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
-        if self._driver_tempdir is not None:
-            driver_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
-            driver_environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
</del><span class="cx">         return driver_environment
</span><del>-
-    def _start(self, pixel_tests, per_test_args):
-        super(WaylandDriver, self).stop()
-        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
-        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()
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpyportwestondriverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/westondriver.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/westondriver.py        2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/westondriver.py   2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">         self._xvfbdriver = XvfbDriver(*args, **kwargs)
</span><span class="cx"> 
</span><span class="cx">     def _setup_environ_for_test(self):
</span><del>-        driver_environment = self._port.setup_environ_for_server(self._server_name)
</del><ins>+        driver_environment = super(WestonDriver, self)._setup_environ_for_test()
</ins><span class="cx">         driver_environment['DISPLAY'] = ":%d" % self._xvfbdriver._xvfb_run(driver_environment)
</span><span class="cx">         weston_socket = 'WKTesting-weston-%032x' % random.getrandbits(128)
</span><span class="cx">         weston_command = ['weston', '--socket=%s' % weston_socket, '--width=1024', '--height=768', '--use-pixman']
</span><span class="lines">@@ -67,12 +67,6 @@
</span><span class="cx">         # Give Weston a bit of time to set itself up.
</span><span class="cx">         time.sleep(self._startup_delay_secs)
</span><span class="cx"> 
</span><del>-        driver_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
-        if self._driver_tempdir is not None:
-            # Currently on WebKit2, there is no API for setting the application cache directory.
-            # Each worker should have its own and it should be cleaned afterwards, when the worker stops.
-            driver_environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
-            driver_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
</del><span class="cx">         driver_environment['WAYLAND_DISPLAY'] = weston_socket
</span><span class="cx">         driver_environment['GDK_BACKEND'] = 'wayland'
</span><span class="cx">         if driver_environment.get('DISPLAY'):
</span><span class="lines">@@ -79,13 +73,6 @@
</span><span class="cx">             del driver_environment['DISPLAY']
</span><span class="cx">         return driver_environment
</span><span class="cx"> 
</span><del>-    def _start(self, pixel_tests, per_test_args):
-        self.stop()
-        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
-        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()
</del><span class="cx"> 
</span><span class="cx">     def stop(self):
</span><span class="cx">         super(WestonDriver, self).stop()
</span><span class="lines">@@ -93,4 +80,3 @@
</span><span class="cx">             # The Weston process is terminated instead of killed, giving the Weston a chance to clean up after itself.
</span><span class="cx">             self._weston_process.terminate()
</span><span class="cx">             self._weston_process = None
</span><del>-
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpyportwestondriver_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/westondriver_unittest.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/westondriver_unittest.py       2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/westondriver_unittest.py  2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     def make_driver(self):
</span><span class="cx">         port = Port(MockSystemHost(log_executive=True), 'westondrivertestport', options=MockOptions(configuration='Release'))
</span><span class="cx">         port._config.build_directory = lambda configuration: "/mock_build"
</span><del>-        port._server_process_constructor = MockServerProcess
</del><ins>+        port._test_runner_process_constructor = MockServerProcess
</ins><span class="cx"> 
</span><span class="cx">         driver = WestonDriver(port, worker_number=0, pixel_tests=True)
</span><span class="cx">         driver._startup_delay_secs = 0
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportxorgdriverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/xorgdriver.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/xorgdriver.py  2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/xorgdriver.py     2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -45,26 +45,8 @@
</span><span class="cx">         return True
</span><span class="cx"> 
</span><span class="cx">     def _setup_environ_for_test(self):
</span><del>-        server_environment = self._port.setup_environ_for_server(self._server_name)
</del><ins>+        server_environment = super(XorgDriver, self)._setup_environ_for_test()
</ins><span class="cx">         self._port._copy_value_from_environ_if_set(server_environment, 'DISPLAY')
</span><span class="cx">         self._port._copy_value_from_environ_if_set(server_environment, 'XAUTHORITY')
</span><span class="cx">         server_environment['GDK_BACKEND'] = 'x11'
</span><del>-        server_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
-        if self._driver_tempdir is not None:
-            server_environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
-            # Currently on WebKit2, there is no API for setting the application
-            # cache directory. Each worker should have it's own and it should be
-            # cleaned afterwards, so we set it to inside the temporary folder by
-            # prepending XDG_CACHE_HOME with DUMPRENDERTREE_TEMP.
-            server_environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
</del><span class="cx">         return server_environment
</span><del>-
-    def _start(self, pixel_tests, per_test_args):
-        super(XorgDriver, self).stop()
-
-        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
-
-        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()
</del></span></pre></div>
<a id="trunkToolsScriptswebkitpyportxvfbdriverpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py  2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py     2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -93,31 +93,17 @@
</span><span class="cx">         return os.environ.get('XVFB_SCREEN_DEPTH', '24')
</span><span class="cx"> 
</span><span class="cx">     def _setup_environ_for_test(self):
</span><del>-        environment = self._port.setup_environ_for_server(self._server_name)
-        display_id = self._xvfb_run(environment)
</del><ins>+        port_server_environment = self._port.setup_environ_for_server(self._server_name)
+        driver_environment = super(XvfbDriver, self)._setup_environ_for_test()
+        display_id = self._xvfb_run(port_server_environment)
</ins><span class="cx"> 
</span><span class="cx">         # We must do this here because the DISPLAY number depends on _worker_number
</span><del>-        environment['DISPLAY'] = ":%d" % display_id
-        environment['UNDER_XVFB'] = 'yes'
-        environment['GDK_BACKEND'] = 'x11'
-        environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
-        if self._driver_tempdir is not None:
-            environment['DUMPRENDERTREE_TEMP'] = str(self._driver_tempdir)
-            # Currently on WebKit2, there is no API for setting the application
-            # cache directory. Each worker should have it's own and it should be
-            # cleaned afterwards, so we set it to inside the temporary folder by
-            # prepending XDG_CACHE_HOME with DUMPRENDERTREE_TEMP.
-            environment['XDG_CACHE_HOME'] = self._port.host.filesystem.join(str(self._driver_tempdir), 'appcache')
-        return environment
</del><ins>+        driver_environment['DISPLAY'] = ":%d" % display_id
+        driver_environment['UNDER_XVFB'] = 'yes'
+        driver_environment['GDK_BACKEND'] = 'x11'
+        driver_environment['LOCAL_RESOURCE_ROOT'] = self._port.layout_tests_dir()
+        return driver_environment
</ins><span class="cx"> 
</span><del>-    def _start(self, pixel_tests, per_test_args):
-        self.stop()
-        self._driver_tempdir = self._port._driver_tempdir(self._target_host)
-        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()
-
</del><span class="cx">     def stop(self):
</span><span class="cx">         super(XvfbDriver, self).stop()
</span><span class="cx">         if getattr(self, '_xvfb_process', None):
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyportxvfbdriver_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py 2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py    2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">     def make_driver(self, worker_number=0, xorg_running=False, executive=None):
</span><span class="cx">         port = Port(MockSystemHost(log_executive=True, executive=executive), 'xvfbdrivertestport', options=MockOptions(configuration='Release'))
</span><span class="cx">         port._config.build_directory = lambda configuration: "/mock-build"
</span><del>-        port._server_process_constructor = MockServerProcess
</del><ins>+        port._test_runner_process_constructor = MockServerProcess
</ins><span class="cx">         if xorg_running:
</span><span class="cx">             port._executive._running_pids['Xorg'] = 108
</span><span class="cx"> 
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">         driver._xvfb_pipe = lambda: (3, 4)
</span><span class="cx">         driver._xvfb_read_display_id = lambda x: 1
</span><span class="cx">         driver._xvfb_close_pipe = lambda p: None
</span><del>-        driver._environment = port.setup_environ_for_server(port.driver_name())
</del><ins>+        driver._port_server_environment = port.setup_environ_for_server(port.driver_name())
</ins><span class="cx">         return driver
</span><span class="cx"> 
</span><span class="cx">     def cleanup_driver(self, driver):
</span><span class="lines">@@ -72,13 +72,13 @@
</span><span class="cx"> 
</span><span class="cx">     def test_start(self):
</span><span class="cx">         driver = self.make_driver()
</span><del>-        expected_logs = ("MOCK popen: ['Xvfb', '-displayfd', '4', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
</del><ins>+        expected_logs = ("MOCK popen: ['Xvfb', '-displayfd', '4', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._port_server_environment)
</ins><span class="cx">         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":1")
</span><span class="cx">         self.cleanup_driver(driver)
</span><span class="cx"> 
</span><span class="cx">     def test_start_arbitrary_worker_number(self):
</span><span class="cx">         driver = self.make_driver(worker_number=17)
</span><del>-        expected_logs = ("MOCK popen: ['Xvfb', '-displayfd', '4', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._environment)
</del><ins>+        expected_logs = ("MOCK popen: ['Xvfb', '-displayfd', '4', '-screen', '0', '1024x768x24', '-nolisten', 'tcp'], env=%s\n" % driver._port_server_environment)
</ins><span class="cx">         self.assertDriverStartSuccessful(driver, expected_logs=expected_logs, expected_display=":1", pixel_tests=True)
</span><span class="cx">         self.cleanup_driver(driver)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpyw3cwpt_runnerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py   2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/w3c/wpt_runner.py      2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx">     # Create the Port-specific driver.
</span><span class="cx">     port._display_server = options.display_server
</span><span class="cx">     display_driver = port.create_driver(worker_number=0, no_timeout=True)._make_driver(pixel_tests=False)
</span><ins>+    display_driver.start(False, [])
</ins><span class="cx">     if not display_driver.check_driver(port):
</span><span class="cx">         raise RuntimeError("Failed to check driver %s" % display_driver.__class__.__name__)
</span><span class="cx">     os.environ.update(display_driver._setup_environ_for_test())
</span></span></pre></div>
<a id="trunkToolsScriptswebkitpywebdriver_testswebdriver_test_runnerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py    2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py       2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">             if not os.path.isfile(os.path.join(self._tests_dir, test)):
</span><span class="cx">                 _log.warning('Test %s does not exist' % test)
</span><span class="cx"> 
</span><ins>+        self._display_driver.start(False, [])
</ins><span class="cx">         env = self._display_driver._setup_environ_for_test()
</span><span class="cx">         self._runners = [runner_cls(self._port, driver, env, self._expectations) for runner_cls in self.RUNNER_CLASSES]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsglibapi_test_runnerpy"></a>
<div class="modfile"><h4>Modified: trunk/Tools/glib/api_test_runner.py (247549 => 247550)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/glib/api_test_runner.py      2019-07-18 00:36:39 UTC (rev 247549)
+++ trunk/Tools/glib/api_test_runner.py 2019-07-18 01:05:51 UTC (rev 247550)
</span><span class="lines">@@ -105,6 +105,7 @@
</span><span class="cx">         return driver
</span><span class="cx"> 
</span><span class="cx">     def _setup_testing_environment(self):
</span><ins>+        self._driver.start(False, [])
</ins><span class="cx">         self._test_env = self._driver._setup_environ_for_test()
</span><span class="cx">         self._test_env["TEST_WEBKIT_API_WEBKIT2_RESOURCES_PATH"] = common.top_level_path("Tools", "TestWebKitAPI", "Tests", "WebKit")
</span><span class="cx">         self._test_env["TEST_WEBKIT_API_WEBKIT2_INJECTED_BUNDLE_PATH"] = common.library_build_path()
</span></span></pre>
</div>
</div>

</body>
</html>