Title: [192569] trunk/Tools
Revision
192569
Author
carlo...@webkit.org
Date
2015-11-18 03:02:43 -0800 (Wed, 18 Nov 2015)

Log Message

Unreviewed. Fix webkitpy tests after r192568.

Instead of ignoring exception when closing mock fds, use a helper
function that the unit test can override to do nothing.

* Scripts/webkitpy/port/xvfbdriver.py:
(XvfbDriver._xvfb_close_pipe):
(XvfbDriver._xvfb_run):
* Scripts/webkitpy/port/xvfbdriver_unittest.py:
(XvfbDriverTest.make_driver):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (192568 => 192569)


--- trunk/Tools/ChangeLog	2015-11-18 09:05:28 UTC (rev 192568)
+++ trunk/Tools/ChangeLog	2015-11-18 11:02:43 UTC (rev 192569)
@@ -1,5 +1,18 @@
 2015-11-18  Carlos Garcia Campos  <cgar...@igalia.com>
 
+        Unreviewed. Fix webkitpy tests after r192568.
+
+        Instead of ignoring exception when closing mock fds, use a helper
+        function that the unit test can override to do nothing.
+
+        * Scripts/webkitpy/port/xvfbdriver.py:
+        (XvfbDriver._xvfb_close_pipe):
+        (XvfbDriver._xvfb_run):
+        * Scripts/webkitpy/port/xvfbdriver_unittest.py:
+        (XvfbDriverTest.make_driver):
+
+2015-11-18  Carlos Garcia Campos  <cgar...@igalia.com>
+
         [XvfbDriver] Fail to run all layout tests when X server started with -displayfd option
         https://bugs.webkit.org/show_bug.cgi?id=151135
 

Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py (192568 => 192569)


--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py	2015-11-18 09:05:28 UTC (rev 192568)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver.py	2015-11-18 11:02:43 UTC (rev 192569)
@@ -72,6 +72,10 @@
 
         return int(display_id)
 
+    def _xvfb_close_pipe(self, pipe_fds):
+        os.close(pipe_fds[0])
+        os.close(pipe_fds[1])
+
     def _xvfb_run(self, environment):
         read_fd, write_fd = self._xvfb_pipe()
         run_xvfb = ["Xvfb", "-displayfd", str(write_fd), "-screen",  "0", "1024x768x%s" % self._xvfb_screen_depth(), "-nolisten", "tcp"]
@@ -81,11 +85,7 @@
             self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull, env=environment)
             display_id = self._xvfb_read_display_id(read_fd)
 
-        try:
-            os.close(read_fd)
-            os.close(write_fd)
-        except OSError:
-            pass
+        self._xvfb_close_pipe((read_fd, write_fd))
 
         return display_id
 

Modified: trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py (192568 => 192569)


--- trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py	2015-11-18 09:05:28 UTC (rev 192568)
+++ trunk/Tools/Scripts/webkitpy/port/xvfbdriver_unittest.py	2015-11-18 11:02:43 UTC (rev 192569)
@@ -53,7 +53,8 @@
         driver._startup_delay_secs = 0
         driver._xvfb_screen_depth = lambda: '24'
         driver._xvfb_pipe = lambda: (3, 4)
-        driver._xvfb_read_display_id = lambda(x): 1
+        driver._xvfb_read_display_id = lambda x: 1
+        driver._xvfb_close_pipe = lambda p: None
         driver._environment = port.setup_environ_for_server(port.driver_name())
         return driver
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to