Changeset 128020 in webkit


Ignore:
Timestamp:
Sep 9, 2012 11:54:43 PM (12 years ago)
Author:
zandobersek@gmail.com
Message:

Clean up the code in XvfbDriver
https://bugs.webkit.org/show_bug.cgi?id=96202

Reviewed by Philippe Normand.

Changes:

  • Remove unneeded imports,
  • assign the _lock_file member variable when the display number is determined,
  • no need for parentheses around a single string format argument,
  • use FileSystem.exists method when checking if lock file is present as it

makes the intention much more clearer.

  • Scripts/webkitpy/layout_tests/port/xvfbdriver.py:

(XvfbDriver._start):
(XvfbDriver.stop):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r127991 r128020  
     12012-09-09  Zan Dobersek  <zandobersek@gmail.com>
     2
     3        Clean up the code in XvfbDriver
     4        https://bugs.webkit.org/show_bug.cgi?id=96202
     5
     6        Reviewed by Philippe Normand.
     7
     8        Changes:
     9        - Remove unneeded imports,
     10        - assign the _lock_file member variable when the display number is determined,
     11        - no need for parentheses around a single string format argument,
     12        - use FileSystem.exists method when checking if lock file is present as it
     13        makes the intention much more clearer.
     14
     15        * Scripts/webkitpy/layout_tests/port/xvfbdriver.py:
     16        (XvfbDriver._start):
     17        (XvfbDriver.stop):
     18
    1192012-09-09  Patrick Gansterer  <paroga@webkit.org>
    220
  • trunk/Tools/Scripts/webkitpy/layout_tests/port/xvfbdriver.py

    r127849 r128020  
    2929import logging
    3030import os
    31 import signal
    32 import subprocess
    3331
    3432from webkitpy.layout_tests.port.server_process import ServerProcess
    3533from webkitpy.layout_tests.port.driver import Driver
    36 from webkitpy.common.system.executive import Executive
    3734
    3835_log = logging.getLogger(__name__)
     
    5552        if pixel_tests:
    5653            display_id += 1
     54        self._lock_file = "/tmp/.X%d-lock" % display_id
     55
    5756        run_xvfb = ["Xvfb", ":%d" % display_id, "-screen",  "0", "800x600x24", "-nolisten", "tcp"]
    5857        with open(os.devnull, 'w') as devnull:
    5958            self._xvfb_process = self._port.host.executive.popen(run_xvfb, stderr=devnull)
    60         self._lock_file = "/tmp/.X%d-lock" % display_id
    6159
    6260        server_name = self._port.driver_name()
    6361        environment = self._port.setup_environ_for_server(server_name)
    6462        # We must do this here because the DISPLAY number depends on _worker_number
    65         environment['DISPLAY'] = ":%d" % (display_id)
     63        environment['DISPLAY'] = ":%d" % display_id
     64
    6665        self._crashed_process_name = None
    6766        self._crashed_pid = None
     
    7473            self._port.host.executive.kill_process(self._xvfb_process.pid)
    7574            self._xvfb_process = None
    76             if self._port.host.filesystem.isfile(self._lock_file):
     75            if self._port.host.filesystem.exists(self._lock_file):
    7776                self._port.host.filesystem.remove(self._lock_file)
Note: See TracChangeset for help on using the changeset viewer.